michael@0: /* michael@0: * Any copyright is dedicated to the Public Domain. michael@0: * http://creativecommons.org/licenses/publicdomain/ michael@0: * Contributor: michael@0: * Jeff Walden michael@0: */ michael@0: michael@0: //----------------------------------------------------------------------------- michael@0: var BUGNUMBER = 721322; michael@0: var summary = michael@0: 'f.arguments must trigger an arguments object in non-strict mode functions'; michael@0: michael@0: print(BUGNUMBER + ": " + summary); michael@0: michael@0: /************** michael@0: * BEGIN TEST * michael@0: **************/ michael@0: michael@0: var obj = michael@0: { michael@0: test: function() michael@0: { michael@0: var args = obj.test.arguments; michael@0: assertEq(args !== null, true); michael@0: assertEq(args[0], 5); michael@0: assertEq(args[1], undefined); michael@0: assertEq(args.length, 2); michael@0: } michael@0: }; michael@0: obj.test(5, undefined); michael@0: michael@0: var sobj = michael@0: { michael@0: test: function() michael@0: { michael@0: "use strict"; michael@0: michael@0: try michael@0: { michael@0: var args = sobj.test.arguments; michael@0: throw new Error("access to arguments property of strict mode " + michael@0: "function didn't throw"); michael@0: } michael@0: catch (e) michael@0: { michael@0: assertEq(e instanceof TypeError, true, michael@0: "should have thrown TypeError, instead got: " + e); michael@0: } michael@0: } michael@0: }; michael@0: sobj.test(5, undefined); michael@0: michael@0: /******************************************************************************/ michael@0: michael@0: if (typeof reportCompare === "function") michael@0: reportCompare(true, true); michael@0: michael@0: print("Tests complete");