Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
michael@0 | 1 | // Any copyright is dedicated to the Public Domain. |
michael@0 | 2 | // http://creativecommons.org/licenses/publicdomain/ |
michael@0 | 3 | // Contributor: Jim Blandy |
michael@0 | 4 | |
michael@0 | 5 | if (typeof findReferences == "function") { |
michael@0 | 6 | (function f() { |
michael@0 | 7 | assertEq(referencesVia(arguments, 'callee', f), true); |
michael@0 | 8 | })(); |
michael@0 | 9 | |
michael@0 | 10 | var o = ({}); |
michael@0 | 11 | |
michael@0 | 12 | function returnHeavy(y) { eval(''); return function heavy() { return y; }; } |
michael@0 | 13 | assertEq(referencesVia(returnHeavy(o), 'fun_callscope; y', o), true); |
michael@0 | 14 | assertEq(referencesVia(returnHeavy(o), 'fun_callscope; shape; base; parent', this), true); |
michael@0 | 15 | |
michael@0 | 16 | function returnBlock(z) { eval(''); let(w = z) { return function block() { return w; }; }; } |
michael@0 | 17 | assertEq(referencesVia(returnBlock(o), 'fun_callscope; w', o), true); |
michael@0 | 18 | |
michael@0 | 19 | function returnWithObj(v) { with(v) return function withObj() { return u; }; } |
michael@0 | 20 | assertEq(referencesVia(returnWithObj(o), 'fun_callscope; type; type_proto', o), true); |
michael@0 | 21 | |
michael@0 | 22 | reportCompare(true, true); |
michael@0 | 23 | } else { |
michael@0 | 24 | reportCompare(true, true, "test skipped: findReferences is not a function"); |
michael@0 | 25 | } |