2 * Any copyright is dedicated to the Public Domain.
3 * http://creativecommons.org/licenses/publicdomain/
6 var gTestfile
= 'this-for-function-expression-recursion.js';
7 var BUGNUMBER
= 611276;
8 var summary
= "JSOP_CALLEE should push undefined, not null, for this";
10 print(BUGNUMBER
+ ": " + summary
);
16 // Calling a named function expression (not function statement) uses the
17 // JSOP_CALLEE opcode. This opcode pushes its own |this|, distinct from the
18 // normal call path; verify that that |this| value is properly |undefined|.
21 function calleeThisFun(recurring
)
25 return calleeThisFun(true);
27 assertEq(calleeThisFun(false), this);
29 var calleeThisStrictFun
=
30 function calleeThisStrictFun(recurring
)
35 return calleeThisStrictFun(true);
37 assertEq(calleeThisStrictFun(false), undefined);
39 /******************************************************************************/
41 if (typeof reportCompare
=== "function")
42 reportCompare(true, true);
44 print("All tests passed!");
46 var successfullyParsed
= true;