Permalink
Browse files

use Function() in compile so it doesn't actually run if there's a bal…

…anced `}) ... ({` construct, also much faster
  • Loading branch information...
substack committed Jun 22, 2012
1 parent ffd4d1d commit 5f5e30ed855b112273869e8a6b4700c470e2f138
Showing with 2 additions and 2 deletions.
  1. +1 −1 index.js
  2. +1 −1 package.json
View
@@ -41,7 +41,7 @@ function compile (n, cb) {
js = String(n.toBuffer());
}
try {
vm.runInNewContext('(function () { ' + js + ' })');
Function(js)
}
catch (e) {
if (cb) cb('Invalid number.')
View
@@ -1,6 +1,6 @@
{
"name" : "number-script",
"version" : "0.0.1",
"version" : "0.0.2",
"description" : "Ordinal JavaScript",
"main" : "index.js",
"bin" : {

0 comments on commit 5f5e30e

Please sign in to comment.