Giter Club home page Giter Club logo

Comments (8)

kevinswiber avatar kevinswiber commented on August 19, 2024

This appears to be an issue with using a regular expression as the argument for String.prototype.split. I tracked it down to the mime module.

(It's this line, copied here for convenience.)

lines = content.split(/[\r\n]+/);

To reproduce outside of this context:

var str = 'Hello World';

console.log(str.split(/\s+/));

Colony:

» colony string_split_problem.js
[]

Node:

» node string_split_problem.js
[ 'Hello', 'World' ]

from t1-runtime.

tcr avatar tcr commented on August 19, 2024

Hi @kevinswiber, this is actually fixed in an unrelated PR (SSL)—let me split that out as a resolution to this issue.

from t1-runtime.

kevinswiber avatar kevinswiber commented on August 19, 2024

Sweet.

I noticed that creating a separate RegExp object and passing that in as an argument works.

Scratch that.

from t1-runtime.

tcr avatar tcr commented on August 19, 2024

Looking good:

runtime git:(tcr-99)  colony try.js
[ 'Hello', 'World' ]runtime git:(tcr-99) 

from t1-runtime.

kevinswiber avatar kevinswiber commented on August 19, 2024

Awesome! Thanks, @tcr!

from t1-runtime.

johnnyman727 avatar johnnyman727 commented on August 19, 2024

@tcr I'm hitting what appears to be an infinite loop when I run the express test. When I SIGINT:

➜  express git:(f6404f3) ✗ colony test.js
^CSIGINT stack traceback:
    [T]: src/colony/lua/colony-js.lua:1: in function 'str_regex_replace'
    [T]: src/colony/lua/colony-js.lua:1: in function 'replace'
    .../express/node_modules/send/node_modules/mime/mime.js:59: in function 'fn'
    [T]: src/colony/lua/colony-js.lua:1: in function 'forEach'
    .../express/node_modules/send/node_modules/mime/mime.js:57: in function 'load'
    .../express/node_modules/send/node_modules/mime/mime.js:90: in function 'res'
    [T]: src/colony/lua/colony-node.lua:1: in function 'run'
    [T]: src/colony/lua/colony-node.lua:1: in function 'require'
    ./node_modules/express/node_modules/send/lib/send.js:6: in function 'res'
    [T]: src/colony/lua/colony-node.lua:1: in function 'run'
    [T]: src/colony/lua/colony-node.lua:1: in function 'require'
    ...
    [T]: src/colony/lua/colony-node.lua:1: in function 'run'
    [T]: src/colony/lua/colony-node.lua:1: in function 'require'
    ./node_modules/express/index.js:2: in function 'res'
    [T]: src/colony/lua/colony-node.lua:1: in function 'run'
    [T]: src/colony/lua/colony-node.lua:1: in function 'require'
    ./test.js:10: in function 'res'
    [T]: src/colony/lua/colony-node.lua:1: in function 'run'
    [T]: src/colony/lua/cli.lua:1: in main chunk
    [C]: in function 'require'
    [T]: runtime:1: in main chunk

from t1-runtime.

tcr avatar tcr commented on August 19, 2024

I'll investigate. Wanna make this another issue?

from t1-runtime.

johnnyman727 avatar johnnyman727 commented on August 19, 2024

Sure thing.

from t1-runtime.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.