Wed, 31 Dec 2014 07:53:36 +0100
Correct small whitespace inconsistency, lost while renaming variables.
1 /// Copyright (c) 2012 Ecma International. All rights reserved.
2 /// Ecma International makes this code available under the terms and conditions set
3 /// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
4 /// "Use Terms"). Any redistribution of this code must retain the above
5 /// copyright and this notice and otherwise comply with the Use Terms.
6 /**
7 * @path ch10/10.6/10.6-13-a-1.js
8 * @description In non-strict mode, arguments object should have its own 'callee' property defined (Step 13.a)
9 */
12 function testcase() {
13 try {
14 Object.defineProperty(Object.prototype, "callee", {
15 value: 1,
16 writable: false,
17 configurable: true
18 });
20 var argObj = (function () { return arguments })();
22 var verifyValue = false;
23 verifyValue = typeof argObj.callee === "function";
25 var verifyWritable = false;
26 argObj.callee = 1001;
27 verifyWritable = (argObj.callee === 1001);
29 var verifyEnumerable = false;
30 for (var p in argObj) {
31 if (p === "callee" && argObj.hasOwnProperty("callee")) {
32 verifyEnumerable = true;
33 }
34 }
36 var verifyConfigurable = false;
37 delete argObj.callee;
38 verifyConfigurable = argObj.hasOwnProperty("callee");
40 return verifyValue && verifyWritable && !verifyEnumerable && !verifyConfigurable;
41 } finally {
42 delete Object.prototype.callee;
43 }
44 }
45 runTestCase(testcase);