Thu, 22 Jan 2015 13:21:57 +0100
Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6
1 // Any copyright is dedicated to the Public Domain.
2 // http://creativecommons.org/licenses/publicdomain/
3 // Contributor: Jim Blandy
5 if (typeof findReferences == "function") {
6 (function f() {
7 assertEq(referencesVia(arguments, 'callee', f), true);
8 })();
10 var o = ({});
12 function returnHeavy(y) { eval(''); return function heavy() { return y; }; }
13 assertEq(referencesVia(returnHeavy(o), 'fun_callscope; y', o), true);
14 assertEq(referencesVia(returnHeavy(o), 'fun_callscope; shape; base; parent', this), true);
16 function returnBlock(z) { eval(''); let(w = z) { return function block() { return w; }; }; }
17 assertEq(referencesVia(returnBlock(o), 'fun_callscope; w', o), true);
19 function returnWithObj(v) { with(v) return function withObj() { return u; }; }
20 assertEq(referencesVia(returnWithObj(o), 'fun_callscope; type; type_proto', o), true);
22 reportCompare(true, true);
23 } else {
24 reportCompare(true, true, "test skipped: findReferences is not a function");
25 }