Skip to content

Instantly share code, notes, and snippets.

@aseemk
Created April 8, 2011 09:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aseemk/909581 to your computer and use it in GitHub Desktop.
Save aseemk/909581 to your computer and use it in GitHub Desktop.
Streamline's compiler chokes on valid JS when a function happens to have a keyword name.
$ node-streamline -c truthy_.js
$ node-streamline -c true_.js
/usr/lib/node/.npm/streamline/0.1.11/package/lib/transform.js:1549
throw new Error(message);
^
Error: error streamlining source: Missing identifier on line 5
at Object.transform (/usr/lib/node/.npm/streamline/0.1.11/package/lib/transform.js:1549:10)
at /usr/lib/node/.npm/streamline/0.1.11/package/lib/compile.js:48:30
at /usr/lib/node/.npm/streamline/0.1.11/package/lib/compile.js:43:206
at /usr/lib/node/.npm/streamline/0.1.11/package/lib/compile.js:2:221
at /usr/lib/node/.npm/streamline/0.1.11/package/lib/compile.js:42:361
at /usr/lib/node/.npm/streamline/0.1.11/package/lib/compile.js:2:221
at /usr/lib/node/.npm/streamline/0.1.11/package/lib/compile.js:42:251
at /usr/lib/node/.npm/streamline/0.1.11/package/lib/compile.js:2:221
require('should');
var foo = true;
setTimeout(_, 1000);
foo.should.be.true('Streamline fails to compile this.');
require('should');
var foo = true;
setTimeout(_, 1000);
foo.should.be.truthy('Streamline compiles this fine.');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment