summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/basic/testWeirdThingsInFunctionConstructor.js
blob: f262f22020027e410e471bc775391717f640e6e8 (plain)
1
2
3
4
5
6
var f = new Function('x', 'var f = 3; if (x) function f() {}; return f');
assertEq(f(false), 3);
assertEq(typeof f(true), "function");

var f = new Function('x', '"use strict"; x = 3; return arguments[0]');
assertEq(f(42), 42);