Comments (11)
It may have to do with having both a split
and replace
with regular expressions on the same line.
See here: https://github.com/broofa/node-mime/blob/48cbcf979b4d1980098217e275f03da33a311c5e/mime.js#L59
var fields = line.replace(/\s*#.*|^\s*|\s*$/g, '').split(/\s+/);
from t1-runtime.
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.
from t1-runtime.
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.
from t1-runtime.
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
Code: https://github.com/svaarala/duktape/tree/master/src
That may be an option.
from t1-runtime.
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
from t1-runtime.
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.
from t1-runtime.
I think #113 fixes this issue of the infinite loop. However, the express sample is still not running. More info being added to #110.
from t1-runtime.
The mime module is trying to split its data file contents by line using this regular expression: [\r\n]+
. The result of the split is wacky and breaks the module, thereby breaking the Content-Type header returned by Express.
More details here: #110 (comment)
from t1-runtime.
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.
from t1-runtime.
This is related to #108. Trouble line: https://github.com/expressjs/parseurl/blob/master/index.js#L17
from t1-runtime.
Express is hitting some other compat issues. Currently, upon require
:
➜ sandbox tessel run server.js
TESSEL! Connected to TM-00-04-f000da30-005d4344-60782586.
INFO Bundling directory /Users/Jon/Work/technical/sandbox (~710.25 KB)
INFO Deploying bundle (1.13 MB)...
INFO Running script...
[T]: src/colony/lua/colony-js.lua:906: bad argument #2 to 'f' (number expected, got nil)
I'm going to close this issue in favor of more specific Node/JS compat issues.
from t1-runtime.
Related Issues (20)
- TLS: cannot provide custom `ca` list on connection HOT 2
- `undefined < 1` results in true HOT 2
- [Colony] error with absolute filepath in argument
- TLS: only DNS type subjectaltnames are supported
- net.isIP accepts hostnames that start with IP-like addresses
- TLS connection dies under ??? circumstances [even/at least under POSIX!] HOT 7
- Writing to an existing file crashes Tessel
- Cannot pass environment variables to scripts when running on mainframe HOT 1
- `Object.create(null)` instances mis-handle numeric keys
- Object.create(undefined) should throw an exception
- Buffer with too many invalid UTF-8 characters triggers abort
- Buffer.prototype.slice mishandles negative index HOT 1
- `Math.ceil` often gives wrong result on device HOT 1
- Keys are not properly coerced to strings, and non-string keys are handled improperly by hasOwnProperty
- DST-related test failure.
- 18 Tests didn't pass! HOT 8
- Date constructor doesn't handle parameters properly
- Can't run blinky example if tessel module is installed locally.
- Regexp's like \W and \1 marked as wrong
- Add Code of Conduct badge HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from t1-runtime.