-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Infinite Loop on Express Test #107
Comments
It may have to do with having both a See here: https://github.com/broofa/node-mime/blob/48cbcf979b4d1980098217e275f03da33a311c5e/mime.js#L59 var fields = line.replace(/\s*#.*|^\s*|\s*$/g, '').split(/\s+/); |
Ah, scratch that. Looks like everything's like getting properly broken into an AST at some point. There's something unfriendly about the expression itself, I think. |
Currently Googling "JavaScript compatible regular expression C library" with a stern look on my face. :/ I'm hoping the issue is easier to solve than that. |
Sorry for the tweet-style issue commenting. If it does come down to needing a regex engine that's JavaScript compatible... I just remembered a project called Duktape. They have a regex engine. Site: http://duktape.org That may be an option. |
Okay... confirmed this doesn't work in colony, though I didn't try using hsregex directly. console.log('Hello World'.replace(/\s|l*/g, '')); In colony, that's an infinite loop. In Node, it's "HeoWord". And for the record, it also appears to work properly in Duktape. Here's the gist I used to test it: https://gist.github.com/kevinswiber/d04bd75725713d42eec2 |
As you can read in the description of the issue linked below, I need an independent, JavaScript-compatible regular expression parser for my own needs, but if you were interested in using Duktape's implementation, as well, the author gives some advice here: svaarala/duktape#12 (comment) Provided I get the time to attempt this, I can always circle back around to Tessel at a later date and see if it plugs in to the runtime nicely. Otherwise, there's likely a quicker fix for this specific issue. |
Fixes zero-length regexp replace. See #107
The mime module is trying to split its data file contents by line using this regular expression: More details here: #110 (comment) |
Just as an update to anyone watching this issue, the Express test no longer goes into an infinite loop but it does not parse paths correctly. |
This is related to #108. Trouble line: https://github.com/expressjs/parseurl/blob/master/index.js#L17 |
Express is hitting some other compat issues. Currently, upon
I'm going to close this issue in favor of more specific Node/JS compat issues. |
See my comment regarding the Express test in the colony test suite.
The text was updated successfully, but these errors were encountered: