js/src/tests/ecma_5/extensions/strict-function-toSource.js

changeset 0
6474c204b198
equal deleted inserted replaced
-1:000000000000 0:e9b3b16f8f74
1 /*
2 * Bug 800407 - Functions defined with Function construcor
3 * do have strict mode when JSOPTION_STRICT_MODE is on.
4 */
5
6 options("strict_mode");
7 function testRunOptionStrictMode(str, arg, result) {
8 var strict_inner = new Function('return typeof this == "undefined";');
9 return strict_inner;
10 }
11 assertEq(eval(uneval(testRunOptionStrictMode()))(), true);
12
13 if (typeof decompileBody !== "undefined") {
14 assertEq(decompileBody(new Function('x', 'return x*2;')).contains('\n"use strict"'), true);
15 }
16
17 reportCompare(true, true);

mercurial