diff options
Diffstat (limited to 'js/src/tests/ecma_5/Function/Function-with-eval.js')
-rw-r--r-- | js/src/tests/ecma_5/Function/Function-with-eval.js | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/js/src/tests/ecma_5/Function/Function-with-eval.js b/js/src/tests/ecma_5/Function/Function-with-eval.js new file mode 100644 index 000000000..981abf2d0 --- /dev/null +++ b/js/src/tests/ecma_5/Function/Function-with-eval.js @@ -0,0 +1,25 @@ +/* + * Any copyright is dedicated to the Public Domain. + * http://creativecommons.org/licenses/publicdomain/ + */ + +assertEq(new Function( + "eval('var foo = 915805');" + + "return foo;" + )(), + 915805); + +assertEq(new Function( + "eval('function foo() {" + + "return 915805;" + + "}');" + + "return foo;" + )()(), + 915805); + +/******************************************************************************/ + +if (typeof reportCompare === "function") + reportCompare(true, true); + +print("Tests complete"); |