summaryrefslogtreecommitdiffstats
path: root/js/src/tests/non262/Function/Function-with-eval.js
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--js/src/tests/non262/Function/Function-with-eval.js25
1 files changed, 25 insertions, 0 deletions
diff --git a/js/src/tests/non262/Function/Function-with-eval.js b/js/src/tests/non262/Function/Function-with-eval.js
new file mode 100644
index 0000000000..981abf2d04
--- /dev/null
+++ b/js/src/tests/non262/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");