Comparing version 1.0.2 to 1.0.3
{ | ||
"name": "evaljs", | ||
"version": "1.0.2", | ||
"version": "1.0.3", | ||
"description": "A JavaScript interpreter written in JavaScript", | ||
@@ -39,4 +39,10 @@ "main": "index.js", | ||
}, | ||
"license": "ISC", | ||
"author": "Marten de Vries", | ||
"license": "ISC" | ||
"contributors": [ | ||
{ "name" : "Jason Huggins", | ||
"email" : "jrhuggins@gmail.com", | ||
"url" : "http://www.hugs.io/" | ||
} | ||
] | ||
} |
@@ -110,5 +110,5 @@ eval.js | ||
**eval.js** is written by Marten de Vries. Credits for the original idea | ||
go to [closure-interpreter][]. | ||
**eval.js** is written by Marten de Vries. Maintained by Jason Huggins. | ||
Credits for the original idea go to [closure-interpreter][]. | ||
[closure-interpreter]: https://www.npmjs.com/package/closure-interpreter | ||
[closure-interpreter]: https://github.com/int3/closure-interpreter |
148
theTest.js
@@ -10,3 +10,3 @@ // not strict, 'cause we need to parse the with statement | ||
var op = { | ||
'+': function (a, b) {return a + b; } | ||
'+': function (a, b) {return a + b; } | ||
}['+']; | ||
@@ -16,7 +16,7 @@ console.log(op(2, 2)); | ||
function Test(name) { | ||
this._name = name; | ||
this._name = name; | ||
} | ||
Test.prototype.hello = function () { | ||
console.log("Hello,", this._name + "!"); | ||
console.log("Hello,", this._name + "!"); | ||
}; | ||
@@ -28,13 +28,13 @@ | ||
for (var i = 0; i < 4; i += 1) { | ||
console.log(i); | ||
console.log(i); | ||
} | ||
if (1) { | ||
console.log(2); | ||
console.log(2); | ||
} | ||
if (0) { | ||
console.warn(1); | ||
console.warn(1); | ||
} else { | ||
console.error(3); | ||
console.error(3); | ||
} | ||
@@ -45,3 +45,3 @@ | ||
(function (name) { | ||
console.log("Hello", name + "!"); | ||
console.log("Hello", name + "!"); | ||
}('Marten')); | ||
@@ -51,4 +51,4 @@ | ||
while (i < 2) { | ||
++i; | ||
console.log(i); | ||
++i; | ||
console.log(i); | ||
} | ||
@@ -60,9 +60,9 @@ | ||
// process.nextTick(function () { | ||
// console.log("Later..."); | ||
// console.log("Later..."); | ||
// }); | ||
function test(def) { | ||
return function () { | ||
return def.abc; | ||
}; | ||
return function () { | ||
return def.abc; | ||
}; | ||
} | ||
@@ -77,4 +77,4 @@ | ||
do { | ||
console.log(i); | ||
i++; | ||
console.log(i); | ||
i++; | ||
} while (i < 2); | ||
@@ -86,3 +86,3 @@ | ||
try { | ||
throw new Error('Hello World!'); | ||
throw new Error('Hello World!'); | ||
} catch (err) { | ||
@@ -93,24 +93,24 @@ } finally { | ||
for (var i = 0; i < 10; i++) { | ||
if (i === 1) { | ||
continue; | ||
} | ||
if (i === 3) { | ||
break; | ||
} | ||
console.log(i); | ||
if (i === 1) { | ||
continue; | ||
} | ||
if (i === 3) { | ||
break; | ||
} | ||
console.log(i); | ||
} | ||
console.log(function () { | ||
var x = 4; | ||
console.log(1); | ||
if (x) { | ||
console.log(2); | ||
for (var i = 0; i < 3; i++) { | ||
console.log(3); | ||
return x; | ||
console.log(5); | ||
} | ||
console.log(6); | ||
} | ||
console.log(7); | ||
var x = 4; | ||
console.log(1); | ||
if (x) { | ||
console.log(2); | ||
for (var i = 0; i < 3; i++) { | ||
console.log(3); | ||
return x; | ||
console.log(5); | ||
} | ||
console.log(6); | ||
} | ||
console.log(7); | ||
}()); | ||
@@ -120,51 +120,51 @@ | ||
switch (x) { | ||
case 1: | ||
console.log(1); | ||
//falls through | ||
case 2: | ||
console.log(2); | ||
case 3: | ||
console.log(3); | ||
break; | ||
case 4: | ||
console.log(4); | ||
default: | ||
console.log(5); | ||
case 1: | ||
console.log(1); | ||
//falls through | ||
case 2: | ||
console.log(2); | ||
case 3: | ||
console.log(3); | ||
break; | ||
case 4: | ||
console.log(4); | ||
default: | ||
console.log(5); | ||
} | ||
switch (x) { | ||
case 1: | ||
console.log(1); | ||
default: | ||
console.log(2); | ||
case 1: | ||
console.log(1); | ||
default: | ||
console.log(2); | ||
} | ||
switch (x) { | ||
case 2: | ||
console.log(3); | ||
break; | ||
default: | ||
console.log(4); | ||
case 2: | ||
console.log(3); | ||
break; | ||
default: | ||
console.log(4); | ||
} | ||
switch (x) { | ||
case 2: | ||
console.log(5); | ||
default: | ||
console.log(6); | ||
case 2: | ||
console.log(5); | ||
default: | ||
console.log(6); | ||
} | ||
switch (x) { | ||
default: | ||
console.log(7); | ||
case 2: | ||
console.log(8); | ||
default: | ||
console.log(7); | ||
case 2: | ||
console.log(8); | ||
} | ||
switch (x) { | ||
default: | ||
console.log(9); | ||
break; | ||
case 2: | ||
console.log(10); | ||
default: | ||
console.log(9); | ||
break; | ||
case 2: | ||
console.log(10); | ||
} | ||
@@ -174,7 +174,7 @@ | ||
for (z in {a: 1, b: 2}) { | ||
console.log(z); | ||
console.log(z); | ||
} | ||
for (var key in {a: 1, b: 2}) { | ||
console.log(key); | ||
console.log(key); | ||
} | ||
@@ -185,3 +185,3 @@ | ||
function abcdefg() { | ||
console.log('should be called'); | ||
console.log('should be called'); | ||
} | ||
@@ -197,4 +197,4 @@ | ||
with ({a: 1, b: 2}) { | ||
console.log(a, b); | ||
console.log(a, b); | ||
} | ||
/*jshint ignore:end*/ |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
284071
14
0