js/src/jit-test/tests/basic/testDynamicLookup.js

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

michael@0 1 (function() { var x = 2; eval("assertEq(x, 2)"); })();
michael@0 2 (function() { var x = 2; (function() { assertEq(x, 2) })() })();
michael@0 3 (function() { var x = 2; (function() { eval("assertEq(x, 2)") })() })();
michael@0 4 (function() { var x = 2; (function() { (function() { assertEq(x, 2) })()})() })();
michael@0 5 (function() { var x = 2; (function() { (function() { eval("assertEq(x, 2)") })()})() })();
michael@0 6
michael@0 7 (function() { var x = 2; with({}) { assertEq(x, 2) } })();
michael@0 8 (function() { var x = 2; with({}) { (function() { assertEq(x, 2) })() } })();
michael@0 9 (function() { var x = 3; with({x:2}) { assertEq(x, 2) } })();
michael@0 10 (function() { var x = 3; with({x:2}) { (function() { assertEq(x, 2) })() } })();
michael@0 11 (function() { var x = 2; (function() { with({}) { assertEq(x, 2) } })() })();
michael@0 12 (function() { var x = 2; (function() { with({}) { (function() { assertEq(x, 2) })() } })() })();
michael@0 13 (function() { var x = 3; (function() { with({x:2}) { assertEq(x, 2) } })() })();
michael@0 14 (function() { var x = 3; (function() { with({x:2}) { (function() { assertEq(x, 2) })() } })() })();
michael@0 15
michael@0 16 (function() { if (Math) function x() {}; assertEq(typeof x, "function") })();
michael@0 17 (function() { if (Math) function x() {}; eval('assertEq(typeof x, "function")') })();
michael@0 18 (function() { if (Math) function x() {}; (function() { assertEq(typeof x, "function") })() })();
michael@0 19 (function() { if (Math) function x() {}; (function() { eval('assertEq(typeof x, "function")') })() })();
michael@0 20
michael@0 21 (function() { eval("var x = 2"); assertEq(x, 2) })();
michael@0 22 (function() { eval("var x = 2"); (function() { assertEq(x, 2) })() })();
michael@0 23 (function() { eval("var x = 2"); (function() { (function() { assertEq(x, 2) })() })() })();
michael@0 24
michael@0 25 (function() { var x = 2; (function() { eval('var y = 3'); assertEq(x, 2) })() })();
michael@0 26 (function() { var x = 2; (function() { eval('var y = 3'); (function() { assertEq(x, 2) })() })() })();
michael@0 27
michael@0 28 (function() { var x = 3; (function() { eval('var x = 2'); assertEq(x, 2) })() })();
michael@0 29 (function() { var x = 3; (function() { eval('var x = 2'); (function() { assertEq(x, 2) })() })() })();
michael@0 30
michael@0 31 (function() { var x = 2; eval("eval('assertEq(x, 2)')") })();
michael@0 32 (function() { var x = 2; (function() { eval("eval('assertEq(x, 2)')") })() })();
michael@0 33 (function() { var x = 2; eval("(function() { eval('assertEq(x, 2)') })()") })();
michael@0 34 (function() { var x = 2; (function() { eval("(function() { eval('assertEq(x, 2)') })()") })() })();
michael@0 35 (function() { var x = 2; (function() { eval("(function() { eval('(function() { assertEq(x, 2) })()') })()") })() })();
michael@0 36
michael@0 37 (function() { var [x] = [2]; eval('assertEq(x, 2)') })();
michael@0 38 (function() { var [x] = [2]; (function() { assertEq(x, 2) })() })();
michael@0 39 (function() { var [x] = [2]; (function() { eval('assertEq(x, 2)') })() })();
michael@0 40 (function() { for (var [x] = [2];;) { return (function() { return assertEq(x, 2); })() } })();
michael@0 41 (function() { for (var [x] = [2];;) { return (function() { return eval('assertEq(x, 2)'); })() } })();
michael@0 42 (function() { let ([x] = [2]) { eval('assertEq(x, 2)') } })();
michael@0 43 (function() { let ([x] = [2]) { (function() { assertEq(x, 2) })() } })();
michael@0 44 (function() { let ([x] = [2]) { (function() { eval('assertEq(x, 2)') })() } })();
michael@0 45
michael@0 46 (function() { var {y:x} = {y:2}; eval('assertEq(x, 2)') })();
michael@0 47 (function() { var {y:x} = {y:2}; (function() { assertEq(x, 2) })() })();
michael@0 48 (function() { var {y:x} = {y:2}; (function() { eval('assertEq(x, 2)') })() })();
michael@0 49 (function() { for (var {y:x} = {y:2};;) { return (function() { return assertEq(x, 2); })() } })();
michael@0 50 (function() { for (var {y:x} = {y:2};;) { return (function() { return eval('assertEq(x, 2)'); })() } })();
michael@0 51 (function() { let ({y:x} = {y:2}) { eval('assertEq(x, 2)') } })();
michael@0 52 (function() { let ({y:x} = {y:2}) { (function() { assertEq(x, 2) })() } })();
michael@0 53 (function() { let ({y:x} = {y:2}) { (function() { eval('assertEq(x, 2)') })() } })();
michael@0 54
michael@0 55 (function([x]) { eval('assertEq(x, 2)') })([2]);
michael@0 56 (function([x]) { (function() { assertEq(x, 2) })() })([2]);
michael@0 57 (function([x]) { (function() { eval('assertEq(x, 2)') })() })([2]);
michael@0 58
michael@0 59 (function f() { assertEq(f.length, 0) })();
michael@0 60 (function f() { eval('assertEq(f.length, 0)') })();
michael@0 61 (function f() { (function f(x) { eval('assertEq(f.length, 1)') })() })();
michael@0 62 (function f() { eval("(function f(x) { eval('assertEq(f.length, 1)') })()") })();
michael@0 63
michael@0 64 (function f() { arguments = 3; function arguments() {}; assertEq(arguments, 3) })();
michael@0 65 (function f() { function arguments() {}; arguments = 3; assertEq(arguments, 3) })();
michael@0 66 (function f() { var arguments = 3; function arguments() {}; assertEq(arguments, 3) })();
michael@0 67 (function f() { function arguments() {}; var arguments = 3; assertEq(arguments, 3) })();
michael@0 68
michael@0 69 function f1() { assertEq(typeof f1, "function") }; f1();
michael@0 70 with({}) { (function() { assertEq(typeof f1, "function") })() }
michael@0 71 if (Math)
michael@0 72 function f2(x) {}
michael@0 73 assertEq(f2.length, 1);

mercurial