michael@0: // Any copyright is dedicated to the Public Domain. michael@0: // http://creativecommons.org/licenses/publicdomain/ michael@0: michael@0: //----------------------------------------------------------------------------- michael@0: var BUGNUMBER = 588251; michael@0: var summary = michael@0: "fun.caller should throw if that value corresponds to a strict mode " + michael@0: "function"; michael@0: michael@0: print(BUGNUMBER + ": " + summary); michael@0: michael@0: /************** michael@0: * BEGIN TEST * michael@0: **************/ michael@0: michael@0: function nonstrict() { return nonstrict.caller; } michael@0: function strict() { "use strict"; return nonstrict(); } michael@0: try michael@0: { michael@0: strict(); michael@0: throw 17; michael@0: } michael@0: catch (e) michael@0: { michael@0: assertEq(e instanceof TypeError, true, michael@0: "expected TypeError accessing strict mode caller, got: " + e); michael@0: } michael@0: michael@0: /******************************************************************************/ michael@0: michael@0: if (typeof reportCompare === "function") michael@0: reportCompare(true, true); michael@0: michael@0: print("All tests passed!");