Reduce reliance on `fnGlobalObject.js`

This harness function is not necessary in the majority of cases in which
it is used. Remove its usage to simplify tests and decrease the amount
of domain-specific knowledge necessary to contribute to the test suite.

Persist the harness function itself for use by future tests for ES2015
modules (such a helper is necessary for tests that are interpreted as
module code).
This commit is contained in:
Mike Pennisi 2016-04-22 13:07:00 -04:00 committed by Gorkem Yakin
parent 9aa4dced8d
commit eb644bb2da
219 changed files with 523 additions and 658 deletions

View File

@ -6,12 +6,10 @@ es5id: B.2.1
description: > description: >
Object.getOwnPropertyDescriptor returns data desc for functions on Object.getOwnPropertyDescriptor returns data desc for functions on
built-ins (Global.escape) built-ins (Global.escape)
includes: includes: [propertyHelper.js]
- fnGlobalObject.js
- propertyHelper.js
---*/ ---*/
var global = fnGlobalObject(); var global = this;
verifyWritable(global, "escape"); verifyWritable(global, "escape");
verifyNotEnumerable(global, "escape"); verifyNotEnumerable(global, "escape");

View File

@ -6,13 +6,9 @@ es5id: B.2.2
description: > description: >
Object.getOwnPropertyDescriptor returns data desc for functions on Object.getOwnPropertyDescriptor returns data desc for functions on
built-ins (Global.unescape) built-ins (Global.unescape)
includes: includes: [propertyHelper.js]
- fnGlobalObject.js
- propertyHelper.js
---*/ ---*/
var global = fnGlobalObject(); verifyWritable(this, "unescape");
verifyNotEnumerable(this, "unescape");
verifyWritable(global, "unescape"); verifyConfigurable(this, "unescape");
verifyNotEnumerable(global, "unescape");
verifyConfigurable(global, "unescape");

View File

@ -4,7 +4,6 @@
/*--- /*---
es5id: 15.4.3.2-1-15 es5id: 15.4.3.2-1-15
description: Array.isArray applied to the global object description: Array.isArray applied to the global object
includes: [fnGlobalObject.js]
---*/ ---*/
assert.sameValue(Array.isArray(fnGlobalObject()), false, 'Array.isArray(fnGlobalObject())'); assert.sameValue(Array.isArray(this), false, 'Array.isArray(this)');

View File

@ -4,7 +4,6 @@
/*--- /*---
es5id: 15.4.4.16-2-15 es5id: 15.4.4.16-2-15
description: Array.prototype.every - 'length' is property of the global object description: Array.prototype.every - 'length' is property of the global object
includes: [fnGlobalObject.js]
---*/ ---*/
function callbackfn1(val, idx, obj) { function callbackfn1(val, idx, obj) {
@ -15,11 +14,11 @@ includes: [fnGlobalObject.js]
return val > 11; return val > 11;
} }
var oldLen = fnGlobalObject().length; var oldLen = this.length;
fnGlobalObject()[0] = 12; this[0] = 12;
fnGlobalObject()[1] = 11; this[1] = 11;
fnGlobalObject()[2] = 9; this[2] = 9;
fnGlobalObject().length = 2; this.length = 2;
assert(Array.prototype.every.call(fnGlobalObject(), callbackfn1), 'Array.prototype.every.call(fnGlobalObject(), callbackfn1) !== true'); assert(Array.prototype.every.call(this, callbackfn1), 'Array.prototype.every.call(this, callbackfn1) !== true');
assert.sameValue(Array.prototype.every.call(fnGlobalObject(), callbackfn2), false, 'Array.prototype.every.call(fnGlobalObject(), callbackfn2)'); assert.sameValue(Array.prototype.every.call(this, callbackfn2), false, 'Array.prototype.every.call(this, callbackfn2)');

View File

@ -5,12 +5,13 @@
es5id: 15.4.4.16-5-1 es5id: 15.4.4.16-5-1
description: Array.prototype.every - thisArg not passed description: Array.prototype.every - thisArg not passed
flags: [noStrict] flags: [noStrict]
includes: [fnGlobalObject.js]
---*/ ---*/
var global = this;
function callbackfn(val, idx, obj) function callbackfn(val, idx, obj)
{ {
return this === fnGlobalObject(); return this === global;
} }
var arr = [1]; var arr = [1];

View File

@ -4,15 +4,15 @@
/*--- /*---
es5id: 15.4.4.16-5-21 es5id: 15.4.4.16-5-21
description: Array.prototype.every - the global object can be used as thisArg description: Array.prototype.every - the global object can be used as thisArg
includes: [fnGlobalObject.js]
---*/ ---*/
var global = this;
var accessed = false; var accessed = false;
function callbackfn(val, idx, obj) { function callbackfn(val, idx, obj) {
accessed = true; accessed = true;
return this === fnGlobalObject(); return this === global;
} }
assert([11].every(callbackfn, fnGlobalObject()), '[11].every(callbackfn, fnGlobalObject()) !== true'); assert([11].every(callbackfn, global), '[11].every(callbackfn, global) !== true');
assert(accessed, 'accessed !== true'); assert(accessed, 'accessed !== true');

View File

@ -6,7 +6,6 @@ es5id: 15.4.4.16-7-c-i-23
description: > description: >
Array.prototype.every - This object is an global object which Array.prototype.every - This object is an global object which
contains index property contains index property
includes: [fnGlobalObject.js]
---*/ ---*/
function callbackfn(val, idx, obj) { function callbackfn(val, idx, obj) {
@ -17,8 +16,8 @@ includes: [fnGlobalObject.js]
} }
} }
var oldLen = fnGlobalObject().length; var oldLen = this.length;
fnGlobalObject()[0] = 11; this[0] = 11;
fnGlobalObject().length = 1; this.length = 1;
assert.sameValue(Array.prototype.every.call(fnGlobalObject(), callbackfn), false, 'Array.prototype.every.call(fnGlobalObject(), callbackfn)'); assert.sameValue(Array.prototype.every.call(this, callbackfn), false, 'Array.prototype.every.call(this, callbackfn)');

View File

@ -6,14 +6,14 @@ es5id: 15.4.4.16-7-c-iii-27
description: > description: >
Array.prototype.every - return value of callbackfn is the global Array.prototype.every - return value of callbackfn is the global
object object
includes: [fnGlobalObject.js]
---*/ ---*/
var global = this;
var accessed = false; var accessed = false;
function callbackfn(val, idx, obj) { function callbackfn(val, idx, obj) {
accessed = true; accessed = true;
return fnGlobalObject(); return global;
} }
assert([11].every(callbackfn), '[11].every(callbackfn) !== true'); assert([11].every(callbackfn), '[11].every(callbackfn) !== true');

View File

@ -4,18 +4,17 @@
/*--- /*---
es5id: 15.4.4.20-2-15 es5id: 15.4.4.20-2-15
description: Array.prototype.filter - 'length' is property of the global object description: Array.prototype.filter - 'length' is property of the global object
includes: [fnGlobalObject.js]
---*/ ---*/
function callbackfn(val, idx, obj) { function callbackfn(val, idx, obj) {
return obj.length === 2; return obj.length === 2;
} }
var oldLen = fnGlobalObject().length; var oldLen = this.length;
fnGlobalObject()[0] = 12; this[0] = 12;
fnGlobalObject()[1] = 11; this[1] = 11;
fnGlobalObject()[2] = 9; this[2] = 9;
fnGlobalObject().length = 2; this.length = 2;
var newArr = Array.prototype.filter.call(fnGlobalObject(), callbackfn); var newArr = Array.prototype.filter.call(this, callbackfn);
assert.sameValue(newArr.length, 2, 'newArr.length'); assert.sameValue(newArr.length, 2, 'newArr.length');

View File

@ -4,17 +4,18 @@
/*--- /*---
es5id: 15.4.4.20-5-21 es5id: 15.4.4.20-5-21
description: Array.prototype.filter - the global object can be used as thisArg description: Array.prototype.filter - the global object can be used as thisArg
includes: [fnGlobalObject.js]
---*/ ---*/
var global = this;
var accessed = false; var accessed = false;
function callbackfn(val, idx, obj) { function callbackfn(val, idx, obj) {
accessed = true; accessed = true;
return this === fnGlobalObject(); return this === global;
} }
var newArr = [11].filter(callbackfn, fnGlobalObject()); var newArr = [11].filter(callbackfn, global);
assert.sameValue(newArr[0], 11, 'newArr[0]'); assert.sameValue(newArr[0], 11, 'newArr[0]');
assert(accessed, 'accessed !== true'); assert(accessed, 'accessed !== true');

View File

@ -6,17 +6,16 @@ es5id: 15.4.4.20-9-c-i-23
description: > description: >
Array.prototype.filter - This object is the global object which Array.prototype.filter - This object is the global object which
contains index property contains index property
includes: [fnGlobalObject.js]
---*/ ---*/
function callbackfn(val, idx, obj) { function callbackfn(val, idx, obj) {
return idx === 0 && val === 11; return idx === 0 && val === 11;
} }
var oldLen = fnGlobalObject().length; var oldLen = this.length;
fnGlobalObject()[0] = 11; this[0] = 11;
fnGlobalObject().length = 1; this.length = 1;
var newArr = Array.prototype.filter.call(fnGlobalObject(), callbackfn); var newArr = Array.prototype.filter.call(this, callbackfn);
assert.sameValue(newArr.length, 1, 'newArr.length'); assert.sameValue(newArr.length, 1, 'newArr.length');
assert.sameValue(newArr[0], 11, 'newArr[0]'); assert.sameValue(newArr[0], 11, 'newArr[0]');

View File

@ -6,11 +6,11 @@ es5id: 15.4.4.20-9-c-iii-28
description: > description: >
Array.prototype.filter - return value of callbackfn is the global Array.prototype.filter - return value of callbackfn is the global
object object
includes: [fnGlobalObject.js]
---*/ ---*/
var global = this;
function callbackfn(val, idx, obj) { function callbackfn(val, idx, obj) {
return fnGlobalObject(); return global;
} }
var newArr = [11].filter(callbackfn); var newArr = [11].filter(callbackfn);

View File

@ -4,7 +4,6 @@
/*--- /*---
es5id: 15.4.4.18-2-15 es5id: 15.4.4.18-2-15
description: Array.prototype.forEach - 'length' is property of the global object description: Array.prototype.forEach - 'length' is property of the global object
includes: [fnGlobalObject.js]
---*/ ---*/
var result = false; var result = false;
@ -12,11 +11,11 @@ includes: [fnGlobalObject.js]
result = (obj.length === 2); result = (obj.length === 2);
} }
var oldLen = fnGlobalObject().length; var oldLen = this.length;
fnGlobalObject()[0] = 12; this[0] = 12;
fnGlobalObject()[1] = 11; this[1] = 11;
fnGlobalObject()[2] = 9; this[2] = 9;
fnGlobalObject().length = 2; this.length = 2;
Array.prototype.forEach.call(fnGlobalObject(), callbackfn); Array.prototype.forEach.call(this, callbackfn);
assert(result, 'result !== true'); assert(result, 'result !== true');

View File

@ -4,14 +4,14 @@
/*--- /*---
es5id: 15.4.4.18-5-21 es5id: 15.4.4.18-5-21
description: Array.prototype.forEach - the global object can be used as thisArg description: Array.prototype.forEach - the global object can be used as thisArg
includes: [fnGlobalObject.js]
---*/ ---*/
var global = this;
var result = false; var result = false;
function callbackfn(val, idx, obj) { function callbackfn(val, idx, obj) {
result = (this === fnGlobalObject()); result = (this === global);
} }
[11].forEach(callbackfn, fnGlobalObject()); [11].forEach(callbackfn, this);
assert(result, 'result !== true'); assert(result, 'result !== true');

View File

@ -6,7 +6,6 @@ es5id: 15.4.4.18-7-c-i-23
description: > description: >
Array.prototype.forEach - This object is an global object which Array.prototype.forEach - This object is an global object which
contains index property contains index property
includes: [fnGlobalObject.js]
---*/ ---*/
var testResult = false; var testResult = false;
@ -17,10 +16,10 @@ includes: [fnGlobalObject.js]
} }
} }
var oldLen = fnGlobalObject().length; var oldLen = this.length;
fnGlobalObject()[0] = 11; this[0] = 11;
fnGlobalObject().length = 1; this.length = 1;
Array.prototype.forEach.call(fnGlobalObject(), callbackfn); Array.prototype.forEach.call(this, callbackfn);
assert(testResult, 'testResult !== true'); assert(testResult, 'testResult !== true');

View File

@ -4,11 +4,10 @@
/*--- /*---
es5id: 15.4.4.14-1-17 es5id: 15.4.4.14-1-17
description: Array.prototype.indexOf applied to the global object description: Array.prototype.indexOf applied to the global object
includes: [fnGlobalObject.js]
---*/ ---*/
var oldLen = fnGlobalObject().length; var oldLen = this.length;
fnGlobalObject()[1] = true; this[1] = true;
fnGlobalObject().length = 2; this.length = 2;
assert.sameValue(Array.prototype.indexOf.call(fnGlobalObject(), true), 1, 'Array.prototype.indexOf.call(fnGlobalObject(), true)'); assert.sameValue(Array.prototype.indexOf.call(this, true), 1, 'Array.prototype.indexOf.call(this, true)');

View File

@ -4,19 +4,18 @@
/*--- /*---
es5id: 15.4.4.14-2-15 es5id: 15.4.4.14-2-15
description: Array.prototype.indexOf - 'length' is property of the global object description: Array.prototype.indexOf - 'length' is property of the global object
includes: [fnGlobalObject.js]
---*/ ---*/
var targetObj = {}; var targetObj = {};
var oldLen = fnGlobalObject().length; var oldLen = this.length;
fnGlobalObject().length = 2; this.length = 2;
fnGlobalObject()[1] = targetObj; this[1] = targetObj;
assert.sameValue(Array.prototype.indexOf.call(fnGlobalObject(), targetObj), 1, 'Array.prototype.indexOf.call(fnGlobalObject(), targetObj)'); assert.sameValue(Array.prototype.indexOf.call(this, targetObj), 1, 'Array.prototype.indexOf.call(this, targetObj)');
fnGlobalObject()[1] = {}; this[1] = {};
fnGlobalObject()[2] = targetObj; this[2] = targetObj;
assert.sameValue(Array.prototype.indexOf.call(fnGlobalObject(), targetObj), -1, 'Array.prototype.indexOf.call(fnGlobalObject(), targetObj)'); assert.sameValue(Array.prototype.indexOf.call(this, targetObj), -1, 'Array.prototype.indexOf.call(this, targetObj)');

View File

@ -4,17 +4,16 @@
/*--- /*---
es5id: 15.4.4.14-9-b-i-23 es5id: 15.4.4.14-9-b-i-23
description: Array.prototype.indexOf - This object is the global object description: Array.prototype.indexOf - This object is the global object
includes: [fnGlobalObject.js]
---*/ ---*/
var targetObj = {}; var targetObj = {};
var oldLen = fnGlobalObject().length; var oldLen = this.length;
fnGlobalObject()[0] = targetObj; this[0] = targetObj;
fnGlobalObject()[100] = "100"; this[100] = "100";
fnGlobalObject()[200] = "200"; this[200] = "200";
fnGlobalObject().length = 200; this.length = 200;
assert.sameValue(Array.prototype.indexOf.call(fnGlobalObject(), targetObj), 0, 'Array.prototype.indexOf.call(fnGlobalObject(), targetObj)'); assert.sameValue(Array.prototype.indexOf.call(this, targetObj), 0, 'Array.prototype.indexOf.call(this, targetObj)');
assert.sameValue(Array.prototype.indexOf.call(fnGlobalObject(), "100"), 100, 'Array.prototype.indexOf.call(fnGlobalObject(), "100")'); assert.sameValue(Array.prototype.indexOf.call(this, "100"), 100, 'Array.prototype.indexOf.call(this, "100")');
assert.sameValue(Array.prototype.indexOf.call(fnGlobalObject(), "200"), -1, 'Array.prototype.indexOf.call(fnGlobalObject(), "200")'); assert.sameValue(Array.prototype.indexOf.call(this, "200"), -1, 'Array.prototype.indexOf.call(this, "200")');

View File

@ -4,13 +4,12 @@
/*--- /*---
es5id: 15.4.4.15-1-17 es5id: 15.4.4.15-1-17
description: Array.prototype.lastIndexOf applied to the global object description: Array.prototype.lastIndexOf applied to the global object
includes: [fnGlobalObject.js]
---*/ ---*/
var targetObj = ["global"]; var targetObj = ["global"];
var oldLen = fnGlobalObject().length; var oldLen = this.length;
fnGlobalObject()[1] = targetObj; this[1] = targetObj;
fnGlobalObject().length = 3; this.length = 3;
assert.sameValue(Array.prototype.lastIndexOf.call(fnGlobalObject(), targetObj), 1, 'Array.prototype.lastIndexOf.call(fnGlobalObject(), targetObj)'); assert.sameValue(Array.prototype.lastIndexOf.call(this, targetObj), 1, 'Array.prototype.lastIndexOf.call(this, targetObj)');

View File

@ -6,19 +6,18 @@ es5id: 15.4.4.15-2-15
description: > description: >
Array.prototype.lastIndexOf - 'length' is property of the global Array.prototype.lastIndexOf - 'length' is property of the global
object object
includes: [fnGlobalObject.js]
---*/ ---*/
var targetObj = {}; var targetObj = {};
var oldLen = fnGlobalObject().length; var oldLen = this.length;
fnGlobalObject().length = 2; this.length = 2;
fnGlobalObject()[1] = targetObj; this[1] = targetObj;
assert.sameValue(Array.prototype.lastIndexOf.call(fnGlobalObject(), targetObj), 1); assert.sameValue(Array.prototype.lastIndexOf.call(this, targetObj), 1);
fnGlobalObject()[1] = {}; this[1] = {};
fnGlobalObject()[2] = targetObj; this[2] = targetObj;
assert.sameValue(Array.prototype.lastIndexOf.call(fnGlobalObject(), targetObj), -1); assert.sameValue(Array.prototype.lastIndexOf.call(this, targetObj), -1);

View File

@ -6,7 +6,6 @@ es5id: 15.4.4.15-3-19
description: > description: >
Array.prototype.lastIndexOf - value of 'length' is an Object which Array.prototype.lastIndexOf - value of 'length' is an Object which
has an own toString method has an own toString method
includes: [fnGlobalObject.js]
---*/ ---*/
// objects inherit the default valueOf() method from Object // objects inherit the default valueOf() method from Object
@ -15,7 +14,7 @@ includes: [fnGlobalObject.js]
// to a number by calling its toString() method and converting the // to a number by calling its toString() method and converting the
// resulting string to a number. // resulting string to a number.
var targetObj = fnGlobalObject(); var targetObj = this;
var obj = { var obj = {
1: targetObj, 1: targetObj,
2: 2, 2: 2,

View File

@ -4,17 +4,16 @@
/*--- /*---
es5id: 15.4.4.15-8-b-i-23 es5id: 15.4.4.15-8-b-i-23
description: Array.prototype.lastIndexOf - This object is the global object description: Array.prototype.lastIndexOf - This object is the global object
includes: [fnGlobalObject.js]
---*/ ---*/
var targetObj = {}; var targetObj = {};
var oldLen = fnGlobalObject().length; var oldLen = this.length;
fnGlobalObject()[0] = targetObj; this[0] = targetObj;
fnGlobalObject()[100] = "100"; this[100] = "100";
fnGlobalObject()[200] = "200"; this[200] = "200";
fnGlobalObject().length = 200; this.length = 200;
assert.sameValue(Array.prototype.lastIndexOf.call(fnGlobalObject(), targetObj), 0, 'Array.prototype.lastIndexOf.call(fnGlobalObject(), targetObj)'); assert.sameValue(Array.prototype.lastIndexOf.call(this, targetObj), 0, 'Array.prototype.lastIndexOf.call(this, targetObj)');
assert.sameValue(Array.prototype.lastIndexOf.call(fnGlobalObject(), "100"), 100, 'Array.prototype.lastIndexOf.call(fnGlobalObject(), "100")'); assert.sameValue(Array.prototype.lastIndexOf.call(this, "100"), 100, 'Array.prototype.lastIndexOf.call(this, "100")');
assert.sameValue(Array.prototype.lastIndexOf.call(fnGlobalObject(), "200"), -1, 'Array.prototype.lastIndexOf.call(fnGlobalObject(), "200")'); assert.sameValue(Array.prototype.lastIndexOf.call(this, "200"), -1, 'Array.prototype.lastIndexOf.call(this, "200")');

View File

@ -6,18 +6,17 @@ es5id: 15.4.4.19-2-15
description: > description: >
Array.prototype.map - when 'length' is property of the global Array.prototype.map - when 'length' is property of the global
object object
includes: [fnGlobalObject.js]
---*/ ---*/
function callbackfn(val, idx, obj) { function callbackfn(val, idx, obj) {
return val > 10; return val > 10;
} }
var oldLen = fnGlobalObject().length; var oldLen = this.length;
fnGlobalObject()[0] = 12; this[0] = 12;
fnGlobalObject()[1] = 11; this[1] = 11;
fnGlobalObject()[2] = 9; this[2] = 9;
fnGlobalObject().length = 2; this.length = 2;
var testResult = Array.prototype.map.call(fnGlobalObject(), callbackfn); var testResult = Array.prototype.map.call(this, callbackfn);
assert.sameValue(testResult.length, 2, 'testResult.length'); assert.sameValue(testResult.length, 2, 'testResult.length');

View File

@ -5,10 +5,9 @@
es5id: 15.4.4.19-5-1 es5id: 15.4.4.19-5-1
description: Array.prototype.map - thisArg not passed description: Array.prototype.map - thisArg not passed
flags: [noStrict] flags: [noStrict]
includes: [fnGlobalObject.js]
---*/ ---*/
fnGlobalObject()._15_4_4_19_5_1 = true; this._15_4_4_19_5_1 = true;
(function() { (function() {
var _15_4_4_19_5_1 = false; var _15_4_4_19_5_1 = false;

View File

@ -4,13 +4,13 @@
/*--- /*---
es5id: 15.4.4.19-5-21 es5id: 15.4.4.19-5-21
description: Array.prototype.map - the global object can be used as thisArg description: Array.prototype.map - the global object can be used as thisArg
includes: [fnGlobalObject.js]
---*/ ---*/
var global = this;
function callbackfn(val, idx, obj) { function callbackfn(val, idx, obj) {
return this === fnGlobalObject(); return this === global;
} }
var testResult = [11].map(callbackfn, fnGlobalObject()); var testResult = [11].map(callbackfn, this);
assert.sameValue(testResult[0], true, 'testResult[0]'); assert.sameValue(testResult[0], true, 'testResult[0]');

View File

@ -6,7 +6,6 @@ es5id: 15.4.4.19-8-c-i-23
description: > description: >
Array.prototype.map - This object is the global object which Array.prototype.map - This object is the global object which
contains index property contains index property
includes: [fnGlobalObject.js]
---*/ ---*/
var kValue = "abc"; var kValue = "abc";
@ -18,10 +17,10 @@ includes: [fnGlobalObject.js]
return false; return false;
} }
var oldLen = fnGlobalObject().length; var oldLen = this.length;
fnGlobalObject()[0] = kValue; this[0] = kValue;
fnGlobalObject().length = 2; this.length = 2;
var testResult = Array.prototype.map.call(fnGlobalObject(), callbackfn); var testResult = Array.prototype.map.call(this, callbackfn);
assert.sameValue(testResult[0], true, 'testResult[0]'); assert.sameValue(testResult[0], true, 'testResult[0]');

View File

@ -4,17 +4,16 @@
/*--- /*---
es5id: 15.4.4.21-2-15 es5id: 15.4.4.21-2-15
description: Array.prototype.reduce - 'length' is property of the global object description: Array.prototype.reduce - 'length' is property of the global object
includes: [fnGlobalObject.js]
---*/ ---*/
function callbackfn(prevVal, curVal, idx, obj) { function callbackfn(prevVal, curVal, idx, obj) {
return (obj.length === 2); return (obj.length === 2);
} }
var oldLen = fnGlobalObject().length; var oldLen = this.length;
fnGlobalObject()[0] = 12; this[0] = 12;
fnGlobalObject()[1] = 11; this[1] = 11;
fnGlobalObject()[2] = 9; this[2] = 9;
fnGlobalObject().length = 2; this.length = 2;
assert.sameValue(Array.prototype.reduce.call(fnGlobalObject(), callbackfn, 1), true, 'Array.prototype.reduce.call(fnGlobalObject(), callbackfn, 1)'); assert.sameValue(Array.prototype.reduce.call(this, callbackfn, 1), true, 'Array.prototype.reduce.call(this, callbackfn, 1)');

View File

@ -6,7 +6,6 @@ es5id: 15.4.4.21-8-b-iii-1-23
description: > description: >
Array.prototype.reduce - This object is the global object which Array.prototype.reduce - This object is the global object which
contains index property contains index property
includes: [fnGlobalObject.js]
---*/ ---*/
var testResult = false; var testResult = false;
@ -16,12 +15,12 @@ includes: [fnGlobalObject.js]
} }
} }
var oldLen = fnGlobalObject().length; var oldLen = this.length;
fnGlobalObject()[0] = 0; this[0] = 0;
fnGlobalObject()[1] = 1; this[1] = 1;
fnGlobalObject()[2] = 2; this[2] = 2;
fnGlobalObject().length = 3; this.length = 3;
Array.prototype.reduce.call(fnGlobalObject(), callbackfn); Array.prototype.reduce.call(this, callbackfn);
assert(testResult, 'testResult !== true'); assert(testResult, 'testResult !== true');

View File

@ -6,7 +6,6 @@ es5id: 15.4.4.21-9-c-i-23
description: > description: >
Array.prototype.reduce - This object is the global object which Array.prototype.reduce - This object is the global object which
contains index property contains index property
includes: [fnGlobalObject.js]
---*/ ---*/
var testResult = false; var testResult = false;
@ -17,11 +16,11 @@ includes: [fnGlobalObject.js]
} }
} }
var oldLen = fnGlobalObject().length; var oldLen = this.length;
fnGlobalObject()[0] = 0; this[0] = 0;
fnGlobalObject()[1] = 1; this[1] = 1;
fnGlobalObject().length = 2; this.length = 2;
Array.prototype.reduce.call(fnGlobalObject(), callbackfn, initialValue); Array.prototype.reduce.call(this, callbackfn, initialValue);
assert(testResult, 'testResult !== true'); assert(testResult, 'testResult !== true');

View File

@ -6,16 +6,16 @@ es5id: 15.4.4.21-9-c-ii-37
description: > description: >
Array.prototype.reduce - the global object can be used as Array.prototype.reduce - the global object can be used as
accumulator accumulator
includes: [fnGlobalObject.js]
---*/ ---*/
var global = this;
var accessed = false; var accessed = false;
function callbackfn(prevVal, curVal, idx, obj) { function callbackfn(prevVal, curVal, idx, obj) {
accessed = true; accessed = true;
return prevVal === fnGlobalObject(); return prevVal === global;
} }
var obj = { 0: 11, length: 1 }; var obj = { 0: 11, length: 1 };
assert.sameValue(Array.prototype.reduce.call(obj, callbackfn, fnGlobalObject()), true, 'Array.prototype.reduce.call(obj, callbackfn, fnGlobalObject())'); assert.sameValue(Array.prototype.reduce.call(obj, callbackfn, this), true, 'Array.prototype.reduce.call(obj, callbackfn, this)');
assert(accessed, 'accessed !== true'); assert(accessed, 'accessed !== true');

View File

@ -6,21 +6,21 @@ es5id: 15.4.4.22-2-15
description: > description: >
Array.prototype.reduceRight - 'length' is property of the global Array.prototype.reduceRight - 'length' is property of the global
object object
includes: [fnGlobalObject.js]
---*/ ---*/
var global = this;
var accessed = false; var accessed = false;
function callbackfn(prevVal, curVal, idx, obj) { function callbackfn(prevVal, curVal, idx, obj) {
accessed = true; accessed = true;
return obj.length === fnGlobalObject().length; return obj.length === global.length;
} }
var oldLen = fnGlobalObject().length; var oldLen = this.length;
fnGlobalObject()[0] = 12; this[0] = 12;
fnGlobalObject()[1] = 11; this[1] = 11;
fnGlobalObject()[2] = 9; this[2] = 9;
fnGlobalObject().length = 2; this.length = 2;
assert(Array.prototype.reduceRight.call(fnGlobalObject(), callbackfn, 111), 'Array.prototype.reduceRight.call(fnGlobalObject(), callbackfn, 111) !== true'); assert(Array.prototype.reduceRight.call(this, callbackfn, 111), 'Array.prototype.reduceRight.call(this, callbackfn, 111) !== true');
assert(accessed, 'accessed !== true'); assert(accessed, 'accessed !== true');

View File

@ -6,7 +6,6 @@ es5id: 15.4.4.22-8-b-iii-1-23
description: > description: >
Array.prototype.reduceRight - This object is the global object Array.prototype.reduceRight - This object is the global object
which contains index property which contains index property
includes: [fnGlobalObject.js]
---*/ ---*/
var testResult = false; var testResult = false;
@ -16,12 +15,12 @@ includes: [fnGlobalObject.js]
} }
} }
var oldLen = fnGlobalObject().length; var oldLen = this.length;
fnGlobalObject()[0] = 0; this[0] = 0;
fnGlobalObject()[1] = 1; this[1] = 1;
fnGlobalObject()[2] = 2; this[2] = 2;
fnGlobalObject().length = 3; this.length = 3;
Array.prototype.reduceRight.call(fnGlobalObject(), callbackfn); Array.prototype.reduceRight.call(this, callbackfn);
assert(testResult, 'testResult !== true'); assert(testResult, 'testResult !== true');

View File

@ -6,7 +6,6 @@ es5id: 15.4.4.22-9-c-i-23
description: > description: >
Array.prototype.reduceRight - This object is an global object Array.prototype.reduceRight - This object is an global object
which contains index property which contains index property
includes: [fnGlobalObject.js]
---*/ ---*/
var testResult = false; var testResult = false;
@ -16,12 +15,12 @@ includes: [fnGlobalObject.js]
} }
} }
var oldLen = fnGlobalObject().length; var oldLen = this.length;
fnGlobalObject()[0] = 0; this[0] = 0;
fnGlobalObject()[1] = 1; this[1] = 1;
fnGlobalObject()[2] = 2; this[2] = 2;
fnGlobalObject().length = 3; this.length = 3;
Array.prototype.reduceRight.call(fnGlobalObject(), callbackfn, "initialValue"); Array.prototype.reduceRight.call(this, callbackfn, "initialValue");
assert(testResult, 'testResult !== true'); assert(testResult, 'testResult !== true');

View File

@ -6,16 +6,16 @@ es5id: 15.4.4.22-9-c-ii-37
description: > description: >
Array.prototype.reduceRight - the global object can be used as Array.prototype.reduceRight - the global object can be used as
accumulator accumulator
includes: [fnGlobalObject.js]
---*/ ---*/
var global = this;
var accessed = false; var accessed = false;
function callbackfn(prevVal, curVal, idx, obj) { function callbackfn(prevVal, curVal, idx, obj) {
accessed = true; accessed = true;
return prevVal === fnGlobalObject(); return prevVal === global;
} }
var obj = { 0: 11, length: 1 }; var obj = { 0: 11, length: 1 };
assert.sameValue(Array.prototype.reduceRight.call(obj, callbackfn, fnGlobalObject()), true, 'Array.prototype.reduceRight.call(obj, callbackfn, fnGlobalObject())'); assert.sameValue(Array.prototype.reduceRight.call(obj, callbackfn, this), true, 'Array.prototype.reduceRight.call(obj, callbackfn, this)');
assert(accessed, 'accessed !== true'); assert(accessed, 'accessed !== true');

View File

@ -4,7 +4,6 @@
/*--- /*---
es5id: 15.4.4.17-2-15 es5id: 15.4.4.17-2-15
description: Array.prototype.some - 'length' is property of the global object description: Array.prototype.some - 'length' is property of the global object
includes: [fnGlobalObject.js]
---*/ ---*/
function callbackfn1(val, idx, obj) { function callbackfn1(val, idx, obj) {
@ -15,11 +14,11 @@ includes: [fnGlobalObject.js]
return val > 11; return val > 11;
} }
var oldLen = fnGlobalObject().length; var oldLen = this.length;
fnGlobalObject()[0] = 9; this[0] = 9;
fnGlobalObject()[1] = 11; this[1] = 11;
fnGlobalObject()[2] = 12; this[2] = 12;
fnGlobalObject().length = 2; this.length = 2;
assert(Array.prototype.some.call(fnGlobalObject(), callbackfn1), 'Array.prototype.some.call(fnGlobalObject(), callbackfn1) !== true'); assert(Array.prototype.some.call(this, callbackfn1), 'Array.prototype.some.call(this, callbackfn1) !== true');
assert.sameValue(Array.prototype.some.call(fnGlobalObject(), callbackfn2), false, 'Array.prototype.some.call(fnGlobalObject(), callbackfn2)'); assert.sameValue(Array.prototype.some.call(this, callbackfn2), false, 'Array.prototype.some.call(this, callbackfn2)');

View File

@ -4,11 +4,11 @@
/*--- /*---
es5id: 15.4.4.17-5-21 es5id: 15.4.4.17-5-21
description: Array.prototype.some - the global object can be used as thisArg description: Array.prototype.some - the global object can be used as thisArg
includes: [fnGlobalObject.js]
---*/ ---*/
var global = this;
function callbackfn(val, idx, obj) { function callbackfn(val, idx, obj) {
return this === fnGlobalObject(); return this === global;
} }
assert([11].some(callbackfn, fnGlobalObject()), '[11].some(callbackfn, fnGlobalObject()) !== true'); assert([11].some(callbackfn, this), '[11].some(callbackfn, global) !== true');

View File

@ -6,7 +6,6 @@ es5id: 15.4.4.17-7-c-i-23
description: > description: >
Array.prototype.some - This object is an global object which Array.prototype.some - This object is an global object which
contains index property contains index property
includes: [fnGlobalObject.js]
---*/ ---*/
function callbackfn(val, idx, obj) { function callbackfn(val, idx, obj) {
@ -16,8 +15,8 @@ includes: [fnGlobalObject.js]
return false; return false;
} }
var oldLen = fnGlobalObject().length; var oldLen = this.length;
fnGlobalObject()[0] = 11; this[0] = 11;
fnGlobalObject().length = 1; this.length = 1;
assert(Array.prototype.some.call(fnGlobalObject(), callbackfn), 'Array.prototype.some.call(fnGlobalObject(), callbackfn) !== true'); assert(Array.prototype.some.call(this, callbackfn), 'Array.prototype.some.call(this, callbackfn) !== true');

View File

@ -6,11 +6,11 @@ es5id: 15.4.4.17-7-c-iii-26
description: > description: >
Array.prototype.some - return value of callbackfn is the global Array.prototype.some - return value of callbackfn is the global
object object
includes: [fnGlobalObject.js]
---*/ ---*/
var global = this;
function callbackfn(val, idx, obj) { function callbackfn(val, idx, obj) {
return fnGlobalObject(); return global;
} }
assert([11].some(callbackfn), '[11].some(callbackfn) !== true'); assert([11].some(callbackfn), '[11].some(callbackfn) !== true');

View File

@ -8,13 +8,13 @@ description: >
non-strict function (strict function declaration called by non-strict function (strict function declaration called by
Function.prototype.apply(globalObject)) Function.prototype.apply(globalObject))
flags: [noStrict] flags: [noStrict]
includes: [fnGlobalObject.js]
---*/ ---*/
var global = this;
function f() { "use strict"; gNonStrict();}; function f() { "use strict"; gNonStrict();};
assert.throws(TypeError, function() { assert.throws(TypeError, function() {
f.apply(fnGlobalObject()); f.apply(global);
}); });
function gNonStrict() { function gNonStrict() {

View File

@ -8,13 +8,13 @@ description: >
non-strict function (strict function declaration called by non-strict function (strict function declaration called by
Function.prototype.call(globalObject)) Function.prototype.call(globalObject))
flags: [noStrict] flags: [noStrict]
includes: [fnGlobalObject.js]
---*/ ---*/
var global = this;
function f() { "use strict"; gNonStrict();}; function f() { "use strict"; gNonStrict();};
assert.throws(TypeError, function() { assert.throws(TypeError, function() {
f.call(fnGlobalObject()); f.call(this);
}); });
function gNonStrict() { function gNonStrict() {

View File

@ -8,13 +8,13 @@ description: >
non-strict function (strict function declaration called by non-strict function (strict function declaration called by
Function.prototype.bind(globalObject)()) Function.prototype.bind(globalObject)())
flags: [noStrict] flags: [noStrict]
includes: [fnGlobalObject.js]
---*/ ---*/
var global = this;
function f() { "use strict"; gNonStrict();}; function f() { "use strict"; gNonStrict();};
assert.throws(TypeError, function() { assert.throws(TypeError, function() {
f.bind(fnGlobalObject())(); f.bind(global)();
}); });
function gNonStrict() { function gNonStrict() {

View File

@ -9,11 +9,11 @@ description: >
strict Function.prototype.apply(globalObject)) strict Function.prototype.apply(globalObject))
flags: [noStrict] flags: [noStrict]
features: [caller] features: [caller]
includes: [fnGlobalObject.js]
---*/ ---*/
var global = this;
function f() { return gNonStrict();}; function f() { return gNonStrict();};
(function () {"use strict"; f.apply(fnGlobalObject()); })(); (function () {"use strict"; f.apply(global); })();
function gNonStrict() { function gNonStrict() {

View File

@ -9,11 +9,11 @@ description: >
strict Function.prototype.call(globalObject)) strict Function.prototype.call(globalObject))
flags: [noStrict] flags: [noStrict]
features: [caller] features: [caller]
includes: [fnGlobalObject.js]
---*/ ---*/
var global = this;
function f() { return gNonStrict();}; function f() { return gNonStrict();};
(function () {"use strict"; f.call(fnGlobalObject()); })(); (function () {"use strict"; f.call(global); })();
function gNonStrict() { function gNonStrict() {

View File

@ -9,11 +9,11 @@ description: >
strict Function.prototype.bind(globalObject)()) strict Function.prototype.bind(globalObject)())
flags: [noStrict] flags: [noStrict]
features: [caller] features: [caller]
includes: [fnGlobalObject.js]
---*/ ---*/
var global = this;
function f() { return gNonStrict();}; function f() { return gNonStrict();};
(function () {"use strict"; f.bind(fnGlobalObject())(); })(); (function () {"use strict"; f.bind(global)(); })();
function gNonStrict() { function gNonStrict() {

View File

@ -6,10 +6,9 @@ es5id: 15.1.1.2-0
description: > description: >
Global.Infinity is a data property with default attribute values Global.Infinity is a data property with default attribute values
(false) (false)
includes: [fnGlobalObject.js]
---*/ ---*/
var desc = Object.getOwnPropertyDescriptor(fnGlobalObject(), 'Infinity'); var desc = Object.getOwnPropertyDescriptor(this, 'Infinity');
assert.sameValue(desc.writable, false, 'desc.writable'); assert.sameValue(desc.writable, false, 'desc.writable');
assert.sameValue(desc.enumerable, false, 'desc.enumerable'); assert.sameValue(desc.enumerable, false, 'desc.enumerable');

View File

@ -5,11 +5,11 @@
info: The Infinity is ReadOnly info: The Infinity is ReadOnly
es5id: 15.1.1.2_A2_T1 es5id: 15.1.1.2_A2_T1
description: Checking typeof Functions description: Checking typeof Functions
includes: [propertyHelper.js, fnGlobalObject.js] includes: [propertyHelper.js]
---*/ ---*/
// CHECK#1 // CHECK#1
verifyNotWritable(fnGlobalObject(), "Infinity", null, true); verifyNotWritable(this, "Infinity", null, true);
if (typeof(Infinity) === "boolean") { if (typeof(Infinity) === "boolean") {
$ERROR('#1: Infinity = true; typeof(Infinity) !== "boolean". Actual: ' + (typeof(Infinity))); $ERROR('#1: Infinity = true; typeof(Infinity) !== "boolean". Actual: ' + (typeof(Infinity)));
} }

View File

@ -5,14 +5,14 @@
info: The Infinity is DontDelete info: The Infinity is DontDelete
es5id: 15.1.1.2_A3_T1 es5id: 15.1.1.2_A3_T1
description: Use delete description: Use delete
includes: [propertyHelper.js, fnGlobalObject.js] includes: [propertyHelper.js]
---*/ ---*/
// CHECK#1 // CHECK#1
verifyNotConfigurable(fnGlobalObject(), "Infinity"); verifyNotConfigurable(this, "Infinity");
try { try {
if (delete fnGlobalObject().Infinity !== false) { if (delete this.Infinity !== false) {
$ERROR('#1: delete Infinity === false.'); $ERROR('#1: delete Infinity === false.');
} }
} catch (e) { } catch (e) {

View File

@ -4,10 +4,9 @@
/*--- /*---
es5id: 15.1.1.1-0 es5id: 15.1.1.1-0
description: Global.NaN is a data property with default attribute values (false) description: Global.NaN is a data property with default attribute values (false)
includes: [fnGlobalObject.js]
---*/ ---*/
var desc = Object.getOwnPropertyDescriptor(fnGlobalObject(), 'NaN'); var desc = Object.getOwnPropertyDescriptor(this, 'NaN');
assert.sameValue(desc.writable, false, 'desc.writable'); assert.sameValue(desc.writable, false, 'desc.writable');
assert.sameValue(desc.enumerable, false, 'desc.enumerable'); assert.sameValue(desc.enumerable, false, 'desc.enumerable');

View File

@ -5,11 +5,11 @@
info: The NaN is ReadOnly info: The NaN is ReadOnly
es5id: 15.1.1.1_A2_T1 es5id: 15.1.1.1_A2_T1
description: Checking typeof Functions description: Checking typeof Functions
includes: [propertyHelper.js, fnGlobalObject.js] includes: [propertyHelper.js]
---*/ ---*/
// CHECK#1 // CHECK#1
verifyNotWritable(fnGlobalObject(), "NaN", null, true); verifyNotWritable(this, "NaN", null, true);
if (typeof(NaN) === "boolean") { if (typeof(NaN) === "boolean") {
$ERROR('#1: NaN = true; typeof(NaN) !== "boolean". Actual: ' + (typeof(NaN))); $ERROR('#1: NaN = true; typeof(NaN) !== "boolean". Actual: ' + (typeof(NaN)));
} }

View File

@ -5,14 +5,14 @@
info: The NaN is DontDelete info: The NaN is DontDelete
es5id: 15.1.1.2_A3_T1 es5id: 15.1.1.2_A3_T1
description: Use delete description: Use delete
includes: [propertyHelper.js, fnGlobalObject.js] includes: [propertyHelper.js]
---*/ ---*/
// CHECK#1 // CHECK#1
verifyNotConfigurable(fnGlobalObject(), "NaN"); verifyNotConfigurable(this, "NaN");
try { try {
if (delete fnGlobalObject().NaN !== false) { if (delete this.NaN !== false) {
$ERROR('#1: delete NaN === false.'); $ERROR('#1: delete NaN === false.');
} }
} catch (e) { } catch (e) {

View File

@ -7,13 +7,12 @@ description: >
Object.create - one property in 'Properties' is the global object Object.create - one property in 'Properties' is the global object
that uses Object's [[Get]] method to access the 'configurable' that uses Object's [[Get]] method to access the 'configurable'
property (8.10.5 step 4.a) property (8.10.5 step 4.a)
includes: [fnGlobalObject.js]
---*/ ---*/
fnGlobalObject().configurable = true; this.configurable = true;
var newObj = Object.create({}, { var newObj = Object.create({}, {
prop: fnGlobalObject() prop: this
}); });
var result1 = newObj.hasOwnProperty("prop"); var result1 = newObj.hasOwnProperty("prop");

View File

@ -6,12 +6,11 @@ es5id: 15.2.3.5-4-149
description: > description: >
Object.create - 'configurable' property of one property in Object.create - 'configurable' property of one property in
'Properties' is the global object (8.10.5 step 4.b) 'Properties' is the global object (8.10.5 step 4.b)
includes: [fnGlobalObject.js]
---*/ ---*/
var newObj = Object.create({}, { var newObj = Object.create({}, {
prop: { prop: {
configurable: fnGlobalObject() configurable: this
} }
}); });

View File

@ -7,13 +7,12 @@ description: >
Object.create - one property in 'Properties' is the global object Object.create - one property in 'Properties' is the global object
that uses Object's [[Get]] method to access the 'value' property that uses Object's [[Get]] method to access the 'value' property
(8.10.5 step 5.a) (8.10.5 step 5.a)
includes: [fnGlobalObject.js]
---*/ ---*/
fnGlobalObject().value = "GlobalValue"; this.value = "GlobalValue";
var newObj = Object.create({}, { var newObj = Object.create({}, {
prop: fnGlobalObject() prop: this
}); });
assert.sameValue(newObj.prop, "GlobalValue", 'newObj.prop'); assert.sameValue(newObj.prop, "GlobalValue", 'newObj.prop');

View File

@ -7,13 +7,12 @@ description: >
Object.create - one property in 'Properties' is the global object Object.create - one property in 'Properties' is the global object
that uses Object's [[Get]] method to access the 'writable' that uses Object's [[Get]] method to access the 'writable'
property (8.10.5 step 6.a) property (8.10.5 step 6.a)
includes: [fnGlobalObject.js]
---*/ ---*/
fnGlobalObject().writable = true; this.writable = true;
var newObj = Object.create({}, { var newObj = Object.create({}, {
prop: fnGlobalObject() prop: this
}); });
var beforeWrite = (newObj.hasOwnProperty("prop") && typeof (newObj.prop) === "undefined"); var beforeWrite = (newObj.hasOwnProperty("prop") && typeof (newObj.prop) === "undefined");

View File

@ -6,12 +6,11 @@ es5id: 15.2.3.5-4-228
description: > description: >
Object.create - 'writable' property of one property in Object.create - 'writable' property of one property in
'Properties' is the global object (8.10.5 step 6.b) 'Properties' is the global object (8.10.5 step 6.b)
includes: [fnGlobalObject.js]
---*/ ---*/
var newObj = Object.create({}, { var newObj = Object.create({}, {
prop: { prop: {
writable: fnGlobalObject() writable: this
} }
}); });
var hasProperty = newObj.hasOwnProperty("prop"); var hasProperty = newObj.hasOwnProperty("prop");

View File

@ -7,15 +7,14 @@ description: >
Object.create - one property in 'Properties' is the global object Object.create - one property in 'Properties' is the global object
that uses Object's [[Get]] method to access the 'get' property that uses Object's [[Get]] method to access the 'get' property
(8.10.5 step 7.a) (8.10.5 step 7.a)
includes: [fnGlobalObject.js]
---*/ ---*/
fnGlobalObject().get = function () { this.get = function () {
return "VerifyGlobalObject"; return "VerifyGlobalObject";
}; };
var newObj = Object.create({}, { var newObj = Object.create({}, {
prop: fnGlobalObject() prop: this
}); });
assert.sameValue(newObj.prop, "VerifyGlobalObject", 'newObj.prop'); assert.sameValue(newObj.prop, "VerifyGlobalObject", 'newObj.prop');

View File

@ -7,17 +7,16 @@ description: >
Object.create - one property in 'Properties' is the global object Object.create - one property in 'Properties' is the global object
that uses Object's [[Get]] method to access the 'set' property that uses Object's [[Get]] method to access the 'set' property
(8.10.5 step 8.a) (8.10.5 step 8.a)
includes: [fnGlobalObject.js]
---*/ ---*/
var data = "data"; var data = "data";
fnGlobalObject().set = function (value) { this.set = function (value) {
data = value; data = value;
}; };
var newObj = Object.create({}, { var newObj = Object.create({}, {
prop: fnGlobalObject() prop: this
}); });
var hasProperty = newObj.hasOwnProperty("prop"); var hasProperty = newObj.hasOwnProperty("prop");

View File

@ -6,14 +6,14 @@ es5id: 15.2.3.5-4-300
description: > description: >
Object.create - 'set' property of one property in 'Properties' is Object.create - 'set' property of one property in 'Properties' is
a host object that isn't callable (8.10.5 step 8.b) a host object that isn't callable (8.10.5 step 8.b)
includes: [fnGlobalObject.js]
---*/ ---*/
var global = this;
assert.throws(TypeError, function() { assert.throws(TypeError, function() {
Object.create({}, { Object.create({}, {
prop: { prop: {
set: fnGlobalObject() set: global
} }
}); });
}); });

View File

@ -7,15 +7,14 @@ description: >
Object.create - one property in 'Properties' is the global object Object.create - one property in 'Properties' is the global object
that uses Object's [[Get]] method to access the 'enumerable' that uses Object's [[Get]] method to access the 'enumerable'
property (8.10.5 step 3.a) property (8.10.5 step 3.a)
includes: [fnGlobalObject.js]
---*/ ---*/
var accessed = false; var accessed = false;
fnGlobalObject().enumerable = true; this.enumerable = true;
var newObj = Object.create({}, { var newObj = Object.create({}, {
prop: fnGlobalObject() prop: this
}); });
for (var property in newObj) { for (var property in newObj) {
if (property === "prop") { if (property === "prop") {

View File

@ -6,14 +6,13 @@ es5id: 15.2.3.5-4-96
description: > description: >
Object.create - 'enumerable' property of one property in Object.create - 'enumerable' property of one property in
'Properties' is the global object (8.10.5 step 3.b) 'Properties' is the global object (8.10.5 step 3.b)
includes: [fnGlobalObject.js]
---*/ ---*/
var accessed = false; var accessed = false;
var newObj = Object.create({}, { var newObj = Object.create({}, {
prop: { prop: {
enumerable: fnGlobalObject() enumerable: this
} }
}); });
for (var property in newObj) { for (var property in newObj) {

View File

@ -6,28 +6,28 @@ es5id: 15.2.3.7-2-18
description: > description: >
Object.defineProperties - argument 'Properties' is the global Object.defineProperties - argument 'Properties' is the global
object object
includes: [fnGlobalObject.js]
---*/ ---*/
var global = this;
var obj = {}; var obj = {};
var result = false; var result = false;
try { try {
Object.defineProperty(fnGlobalObject(), "prop", { Object.defineProperty(this, "prop", {
get: function () { get: function () {
result = (this === fnGlobalObject()); result = (this === global);
return {}; return {};
}, },
enumerable: true, enumerable: true,
configurable:true configurable:true
}); });
Object.defineProperties(obj, fnGlobalObject()); Object.defineProperties(obj, this);
} catch (e) { } catch (e) {
if (!(e instanceof TypeError)) throw e; if (!(e instanceof TypeError)) throw e;
result = true; result = true;
} finally { } finally {
delete fnGlobalObject().prop; delete this.prop;
} }
assert(result, 'result !== true'); assert(result, 'result !== true');

View File

@ -6,14 +6,13 @@ es5id: 15.2.3.7-5-b-109
description: > description: >
Object.defineProperties - value of 'configurable' property of Object.defineProperties - value of 'configurable' property of
'descObj' is the global object (8.10.5 step 4.b) 'descObj' is the global object (8.10.5 step 4.b)
includes: [fnGlobalObject.js]
---*/ ---*/
var obj = {}; var obj = {};
Object.defineProperties(obj, { Object.defineProperties(obj, {
property: { property: {
configurable: fnGlobalObject() configurable: this
} }
}); });
var preCheck = obj.hasOwnProperty("property"); var preCheck = obj.hasOwnProperty("property");

View File

@ -7,15 +7,14 @@ description: >
Object.defineProperties - 'descObj' is the global object which Object.defineProperties - 'descObj' is the global object which
implements its own [[Get]] method to get 'value' property (8.10.5 implements its own [[Get]] method to get 'value' property (8.10.5
step 5.a) step 5.a)
includes: [fnGlobalObject.js]
---*/ ---*/
var obj = {}; var obj = {};
fnGlobalObject().value = "global"; this.value = "global";
Object.defineProperties(obj, { Object.defineProperties(obj, {
property: fnGlobalObject() property: this
}); });
assert.sameValue(obj.property, "global", 'obj.property'); assert.sameValue(obj.property, "global", 'obj.property');

View File

@ -7,18 +7,16 @@ description: >
Object.defineProperties - 'descObj' is the global object which Object.defineProperties - 'descObj' is the global object which
implements its own [[Get]] method to get 'writable' property implements its own [[Get]] method to get 'writable' property
(8.10.5 step 6.a) (8.10.5 step 6.a)
includes: includes: [propertyHelper.js]
- propertyHelper.js
- fnGlobalObject.js
---*/ ---*/
var obj = {}; var obj = {};
fnGlobalObject().writable = false; this.writable = false;
Object.defineProperties(obj, { Object.defineProperties(obj, {
property: fnGlobalObject() property: this
}); });
assert(obj.hasOwnProperty("property")); assert(obj.hasOwnProperty("property"));

View File

@ -6,14 +6,13 @@ es5id: 15.2.3.7-5-b-188
description: > description: >
Object.defineProperties - value of 'writable' property of Object.defineProperties - value of 'writable' property of
'descObj' is the global object (8.10.5 step 6.b) 'descObj' is the global object (8.10.5 step 6.b)
includes: [fnGlobalObject.js]
---*/ ---*/
var obj = {}; var obj = {};
Object.defineProperties(obj, { Object.defineProperties(obj, {
property: { property: {
writable: fnGlobalObject() writable: this
} }
}); });

View File

@ -7,17 +7,16 @@ description: >
Object.defineProperties - 'descObj' is the global object which Object.defineProperties - 'descObj' is the global object which
implements its own [[Get]] method to get 'get' property (8.10.5 implements its own [[Get]] method to get 'get' property (8.10.5
step 7.a) step 7.a)
includes: [fnGlobalObject.js]
---*/ ---*/
var obj = {}; var obj = {};
fnGlobalObject().get = function () { this.get = function () {
return "global"; return "global";
}; };
Object.defineProperties(obj, { Object.defineProperties(obj, {
property: fnGlobalObject() property: this
}); });
assert.sameValue(obj.property, "global", 'obj.property'); assert.sameValue(obj.property, "global", 'obj.property');

View File

@ -7,16 +7,15 @@ description: >
Object.defineProperties - 'descObj' is the global object which Object.defineProperties - 'descObj' is the global object which
implements its own [[Get]] method to get 'enumerable' property implements its own [[Get]] method to get 'enumerable' property
(8.10.5 step 3.a) (8.10.5 step 3.a)
includes: [fnGlobalObject.js]
---*/ ---*/
var obj = {}; var obj = {};
var accessed = false; var accessed = false;
fnGlobalObject().enumerable = true; this.enumerable = true;
Object.defineProperties(obj, { Object.defineProperties(obj, {
prop: fnGlobalObject() prop: this
}); });
for (var property in obj) { for (var property in obj) {
if (property === "prop") { if (property === "prop") {

View File

@ -6,7 +6,6 @@ es5id: 15.2.3.7-5-b-56
description: > description: >
Object.defineProperties - value of 'enumerable' property of Object.defineProperties - value of 'enumerable' property of
'descObj' is the global object (8.10.5 step 3.b) 'descObj' is the global object (8.10.5 step 3.b)
includes: [fnGlobalObject.js]
---*/ ---*/
var obj = {}; var obj = {};
@ -14,7 +13,7 @@ includes: [fnGlobalObject.js]
Object.defineProperties(obj, { Object.defineProperties(obj, {
prop: { prop: {
enumerable: fnGlobalObject() enumerable: this
} }
}); });
for (var property in obj) { for (var property in obj) {

View File

@ -7,15 +7,14 @@ description: >
Object.defineProperties - 'descObj' is the global object which Object.defineProperties - 'descObj' is the global object which
implements its own [[Get]] method to get 'configurable' property implements its own [[Get]] method to get 'configurable' property
(8.10.5 step 4.a) (8.10.5 step 4.a)
includes: [fnGlobalObject.js]
---*/ ---*/
var obj = {}; var obj = {};
fnGlobalObject().configurable = true; this.configurable = true;
Object.defineProperties(obj, { Object.defineProperties(obj, {
prop: fnGlobalObject() prop: this
}); });
var result1 = obj.hasOwnProperty("prop"); var result1 = obj.hasOwnProperty("prop");

View File

@ -7,29 +7,29 @@ description: >
Object.defineProperties - 'O' is the global object which Object.defineProperties - 'O' is the global object which
implements its own [[GetOwnProperty]] method to get 'P' (8.12.9 implements its own [[GetOwnProperty]] method to get 'P' (8.12.9
step 1 ) step 1 )
includes: [propertyHelper.js, fnGlobalObject.js] includes: [propertyHelper.js]
---*/ ---*/
Object.defineProperty(fnGlobalObject(), "prop", { Object.defineProperty(this, "prop", {
value: 11, value: 11,
writable: true, writable: true,
enumerable: true, enumerable: true,
configurable: true configurable: true
}); });
Object.defineProperties(fnGlobalObject(), { Object.defineProperties(this, {
prop: { prop: {
value: 12 value: 12
} }
}); });
verifyEqualTo(fnGlobalObject(), "prop", 12); verifyEqualTo(this, "prop", 12);
verifyWritable(fnGlobalObject(), "prop"); verifyWritable(this, "prop");
verifyEnumerable(fnGlobalObject(), "prop"); verifyEnumerable(this, "prop");
verifyConfigurable(fnGlobalObject(), "prop"); verifyConfigurable(this, "prop");
delete fnGlobalObject().prop; delete this.prop;

View File

@ -6,13 +6,12 @@ es5id: 15.2.3.6-3-123
description: > description: >
Object.defineProperty - 'configurable' property in 'Attributes' is Object.defineProperty - 'configurable' property in 'Attributes' is
the global object (8.10.5 step 4.b) the global object (8.10.5 step 4.b)
includes: [fnGlobalObject.js]
---*/ ---*/
var obj = {}; var obj = {};
var attr = { var attr = {
configurable: fnGlobalObject() configurable: this
}; };
Object.defineProperty(obj, "property", attr); Object.defineProperty(obj, "property", attr);

View File

@ -7,13 +7,12 @@ description: >
Object.defineProperty - 'Attributes' is the global object that Object.defineProperty - 'Attributes' is the global object that
uses Object's [[Get]] method to access the 'value' property uses Object's [[Get]] method to access the 'value' property
(8.10.5 step 5.a) (8.10.5 step 5.a)
includes: [fnGlobalObject.js]
---*/ ---*/
var obj = {}; var obj = {};
fnGlobalObject().value = "global"; this.value = "global";
Object.defineProperty(obj, "property", fnGlobalObject()); Object.defineProperty(obj, "property", this);
assert.sameValue(obj.property, "global", 'obj.property'); assert.sameValue(obj.property, "global", 'obj.property');

View File

@ -7,14 +7,13 @@ description: >
Object.defineProperty - 'Attributes' is the global object that Object.defineProperty - 'Attributes' is the global object that
uses Object's [[Get]] method to access the 'writable' property uses Object's [[Get]] method to access the 'writable' property
(8.10.5 step 6.a) (8.10.5 step 6.a)
includes: [fnGlobalObject.js]
---*/ ---*/
var obj = {}; var obj = {};
fnGlobalObject().writable = true; this.writable = true;
Object.defineProperty(obj, "property", fnGlobalObject()); Object.defineProperty(obj, "property", this);
var beforeWrite = obj.hasOwnProperty("property"); var beforeWrite = obj.hasOwnProperty("property");

View File

@ -6,13 +6,12 @@ es5id: 15.2.3.6-3-202
description: > description: >
Object.defineProperty - 'writable' property in 'Attributes' is the Object.defineProperty - 'writable' property in 'Attributes' is the
global object (8.10.5 step 6.b) global object (8.10.5 step 6.b)
includes: [fnGlobalObject.js]
---*/ ---*/
var obj = {}; var obj = {};
Object.defineProperty(obj, "property", { Object.defineProperty(obj, "property", {
writable: fnGlobalObject() writable: this
}); });
var beforeWrite = obj.hasOwnProperty("property"); var beforeWrite = obj.hasOwnProperty("property");

View File

@ -7,15 +7,14 @@ description: >
Object.defineProperty - 'Attributes' is the global object that Object.defineProperty - 'Attributes' is the global object that
uses Object's [[Get]] method to access the 'get' property (8.10.5 uses Object's [[Get]] method to access the 'get' property (8.10.5
step 7.a) step 7.a)
includes: [fnGlobalObject.js]
---*/ ---*/
var obj = {}; var obj = {};
fnGlobalObject().get = function () { this.get = function () {
return "globalGetProperty"; return "globalGetProperty";
}; };
Object.defineProperty(obj, "property", fnGlobalObject()); Object.defineProperty(obj, "property", this);
assert.sameValue(obj.property, "globalGetProperty", 'obj.property'); assert.sameValue(obj.property, "globalGetProperty", 'obj.property');

View File

@ -7,17 +7,16 @@ description: >
Object.defineProperty - 'Attributes' is the global object that Object.defineProperty - 'Attributes' is the global object that
uses Object's [[Get]] method to access the 'set' property (8.10.5 uses Object's [[Get]] method to access the 'set' property (8.10.5
step 8.a) step 8.a)
includes: [fnGlobalObject.js]
---*/ ---*/
var obj = {}; var obj = {};
var data = "data"; var data = "data";
fnGlobalObject().set = function (value) { this.set = function (value) {
data = value; data = value;
}; };
Object.defineProperty(obj, "property", fnGlobalObject()); Object.defineProperty(obj, "property", this);
obj.property = "overrideData"; obj.property = "overrideData";
assert(obj.hasOwnProperty("property"), 'obj.hasOwnProperty("property") !== true'); assert(obj.hasOwnProperty("property"), 'obj.hasOwnProperty("property") !== true');

View File

@ -7,15 +7,14 @@ description: >
Object.defineProperty - 'Attributes' is the global object that Object.defineProperty - 'Attributes' is the global object that
uses Object's [[Get]] method to access the 'enumerable' property uses Object's [[Get]] method to access the 'enumerable' property
(8.10.5 step 3.a) (8.10.5 step 3.a)
includes: [fnGlobalObject.js]
---*/ ---*/
var obj = {}; var obj = {};
var accessed = false; var accessed = false;
fnGlobalObject().enumerable = true; this.enumerable = true;
Object.defineProperty(obj, "property", fnGlobalObject()); Object.defineProperty(obj, "property", this);
for (var prop in obj) { for (var prop in obj) {
if (prop === "property") { if (prop === "property") {

View File

@ -6,13 +6,12 @@ es5id: 15.2.3.6-3-70
description: > description: >
Object.defineProperty - value of 'enumerable' property in Object.defineProperty - value of 'enumerable' property in
'Attributes' is the global object (8.10.5 step 3.b) 'Attributes' is the global object (8.10.5 step 3.b)
includes: [fnGlobalObject.js]
---*/ ---*/
var obj = {}; var obj = {};
var accessed = false; var accessed = false;
Object.defineProperty(obj, "property", { enumerable: fnGlobalObject() }); Object.defineProperty(obj, "property", { enumerable: this });
for (var prop in obj) { for (var prop in obj) {
if (prop === "property") { if (prop === "property") {

View File

@ -7,14 +7,13 @@ description: >
Object.defineProperty - 'Attributes' is the global object that Object.defineProperty - 'Attributes' is the global object that
uses Object's [[Get]] method to access the 'configurable' property uses Object's [[Get]] method to access the 'configurable' property
(8.10.5 step 4.a) (8.10.5 step 4.a)
includes: [fnGlobalObject.js]
---*/ ---*/
var obj = {}; var obj = {};
fnGlobalObject().configurable = true; this.configurable = true;
Object.defineProperty(obj, "property", fnGlobalObject()); Object.defineProperty(obj, "property", this);
var beforeDeleted = obj.hasOwnProperty("property"); var beforeDeleted = obj.hasOwnProperty("property");

View File

@ -8,11 +8,11 @@ description: >
property successfully when [[Configurable]] attribute is true and property successfully when [[Configurable]] attribute is true and
[[Writable]] attribute is false, 'O' is the global object (8.12.9 [[Writable]] attribute is false, 'O' is the global object (8.12.9
- step Note) - step Note)
includes: [propertyHelper.js, fnGlobalObject.js] includes: [propertyHelper.js]
---*/ ---*/
var obj = fnGlobalObject(); var obj = this;
try { try {
Object.defineProperty(obj, "0", { Object.defineProperty(obj, "0", {

View File

@ -8,7 +8,7 @@ description: >
property 'P' successfully when [[Configurable]] attribute is true property 'P' successfully when [[Configurable]] attribute is true
and [[Writable]] attribute is false, 'A' is an Array object and [[Writable]] attribute is false, 'A' is an Array object
(8.12.9 step - Note) (8.12.9 step - Note)
includes: [propertyHelper.js, fnGlobalObject.js] includes: [propertyHelper.js]
---*/ ---*/

View File

@ -7,11 +7,11 @@ description: >
Object.defineProperty will update [[Value]] attribute successfully Object.defineProperty will update [[Value]] attribute successfully
when [[Configurable]] attribute is true and [[Writable]] attribute when [[Configurable]] attribute is true and [[Writable]] attribute
is false, 'O' is the global object (8.12.9 - step Note) is false, 'O' is the global object (8.12.9 - step Note)
includes: [propertyHelper.js, fnGlobalObject.js] includes: [propertyHelper.js]
---*/ ---*/
var obj = fnGlobalObject(); var obj = this;
try { try {
Object.defineProperty(obj, "property", { Object.defineProperty(obj, "property", {

View File

@ -7,12 +7,10 @@ description: >
ES5 Attributes - property 'P' with attributes [[Writable]]: false, ES5 Attributes - property 'P' with attributes [[Writable]]: false,
[[Enumerable]]: true, [[Configurable]]: true is non-writable using [[Enumerable]]: true, [[Configurable]]: true is non-writable using
simple assignment, 'O' is the global object simple assignment, 'O' is the global object
includes: includes: [propertyHelper.js]
- propertyHelper.js
- fnGlobalObject.js
---*/ ---*/
var obj = fnGlobalObject(); var obj = this;
Object.defineProperty(obj, "prop", { Object.defineProperty(obj, "prop", {
value: 2010, value: 2010,

View File

@ -8,12 +8,10 @@ description: >
[[Writable]]: false, [[Enumerable]]: true, [[Configurable]]: true [[Writable]]: false, [[Enumerable]]: true, [[Configurable]]: true
to an accessor property, 'O' is the global object (8.12.9 - step to an accessor property, 'O' is the global object (8.12.9 - step
9.b.i) 9.b.i)
includes: includes: [propertyHelper.js]
- propertyHelper.js
- fnGlobalObject.js
---*/ ---*/
var obj = fnGlobalObject(); var obj = this;
Object.defineProperty(obj, "prop", { Object.defineProperty(obj, "prop", {
value: 2010, value: 2010,

View File

@ -8,14 +8,14 @@ description: >
attributes are [[Writable]]: false, [[Enumerable]]: true, attributes are [[Writable]]: false, [[Enumerable]]: true,
[[Configurable]]: true to an accessor property, 'O' is the global [[Configurable]]: true to an accessor property, 'O' is the global
object (8.12.9 - step 9.b.i) object (8.12.9 - step 9.b.i)
includes: [propertyHelper.js, fnGlobalObject.js] includes: [propertyHelper.js]
---*/ ---*/
function getFunc() { function getFunc() {
return 20; return 20;
} }
var obj = fnGlobalObject(); var obj = this;
try { try {
Object.defineProperty(obj, "0", { Object.defineProperty(obj, "0", {
value: 2010, value: 2010,

View File

@ -6,16 +6,15 @@ es5id: 15.2.3.6-4-399
description: > description: >
ES5 Attributes - [[Value]] attribute of data property is the ES5 Attributes - [[Value]] attribute of data property is the
global object global object
includes: [fnGlobalObject.js]
---*/ ---*/
var obj = {}; var obj = {};
Object.defineProperty(obj, "prop", { Object.defineProperty(obj, "prop", {
value: fnGlobalObject() value: this
}); });
var desc = Object.getOwnPropertyDescriptor(obj, "prop"); var desc = Object.getOwnPropertyDescriptor(obj, "prop");
assert.sameValue(obj.prop, fnGlobalObject(), 'obj.prop'); assert.sameValue(obj.prop, this, 'obj.prop');
assert.sameValue(desc.value, fnGlobalObject(), 'desc.value'); assert.sameValue(desc.value, this, 'desc.value');

View File

@ -7,18 +7,18 @@ description: >
Object.defineProperty - 'O' is the global object that uses Object.defineProperty - 'O' is the global object that uses
Object's [[GetOwnProperty]] method to access the 'name' property Object's [[GetOwnProperty]] method to access the 'name' property
(8.12.9 step 1) (8.12.9 step 1)
includes: [propertyHelper.js, fnGlobalObject.js] includes: [propertyHelper.js]
---*/ ---*/
Object.defineProperty(fnGlobalObject(), "foo", { Object.defineProperty(this, "foo", {
value: 12, value: 12,
configurable: true configurable: true
}); });
verifyEqualTo(fnGlobalObject(), "foo", 12); verifyEqualTo(this, "foo", 12);
verifyNotWritable(fnGlobalObject(), "foo"); verifyNotWritable(this, "foo");
verifyNotEnumerable(fnGlobalObject(), "foo"); verifyNotEnumerable(this, "foo");
verifyConfigurable(fnGlobalObject(), "foo"); verifyConfigurable(this, "foo");

View File

@ -8,11 +8,11 @@ description: >
of indexed accessor property 'P' successfully when of indexed accessor property 'P' successfully when
[[Configurable]] attribute is true, 'O' is the global object [[Configurable]] attribute is true, 'O' is the global object
(8.12.9 step 11) (8.12.9 step 11)
includes: [propertyHelper.js, fnGlobalObject.js] includes: [propertyHelper.js]
---*/ ---*/
var obj = fnGlobalObject(); var obj = this;
try { try {
obj.verifySetFunction = "data"; obj.verifySetFunction = "data";
Object.defineProperty(obj, "0", { Object.defineProperty(obj, "0", {

View File

@ -7,10 +7,9 @@ description: >
ES5 Attributes - Updating an indexed accessor property 'P' using ES5 Attributes - Updating an indexed accessor property 'P' using
simple assignment is successful, 'O' is the global object (8.12.5 simple assignment is successful, 'O' is the global object (8.12.5
step 5.b) step 5.b)
includes: [fnGlobalObject.js]
---*/ ---*/
var obj = fnGlobalObject(); var obj = this;
obj.verifySetFunc = "data"; obj.verifySetFunc = "data";
var setFunc = function (value) { var setFunc = function (value) {

View File

@ -7,11 +7,11 @@ description: >
Object.defineProperty will update [[Get]] and [[Set]] attributes Object.defineProperty will update [[Get]] and [[Set]] attributes
of named accessor property 'P' successfully when [[Configurable]] of named accessor property 'P' successfully when [[Configurable]]
attribute is true, 'O' is the global object (8.12.9 step 11) attribute is true, 'O' is the global object (8.12.9 step 11)
includes: [propertyHelper.js, fnGlobalObject.js] includes: [propertyHelper.js]
---*/ ---*/
var obj = fnGlobalObject(); var obj = this;
try { try {
obj.verifySetFunction = "data"; obj.verifySetFunction = "data";
Object.defineProperty(obj, "property", { Object.defineProperty(obj, "property", {

View File

@ -7,12 +7,10 @@ description: >
ES5 Attributes - Updating a named accessor property 'P' without ES5 Attributes - Updating a named accessor property 'P' without
[[Set]] using simple assignment is failed, 'O' is the global [[Set]] using simple assignment is failed, 'O' is the global
object (8.12.5 step 5.b) object (8.12.5 step 5.b)
includes: includes: [propertyHelper.js]
- propertyHelper.js
- fnGlobalObject.js
---*/ ---*/
var obj = fnGlobalObject(); var obj = this;
obj.verifySetFunc = "data"; obj.verifySetFunc = "data";
var getFunc = function () { var getFunc = function () {

View File

@ -7,10 +7,10 @@ description: >
ES5 Attributes - Updating a named accessor property 'P' whose ES5 Attributes - Updating a named accessor property 'P' whose
[[Configurable]] attribute is true to a data property is [[Configurable]] attribute is true to a data property is
successful, 'O' is the global object successful, 'O' is the global object
includes: [propertyHelper.js, fnGlobalObject.js] includes: [propertyHelper.js]
---*/ ---*/
var obj = fnGlobalObject(); var obj = this;
obj.verifySetFunc = "data"; obj.verifySetFunc = "data";
var getFunc = function () { var getFunc = function () {

View File

@ -7,10 +7,10 @@ description: >
ES5 Attributes - Updating an indexed accessor property 'P' whose ES5 Attributes - Updating an indexed accessor property 'P' whose
[[Configurable]] attribute is true to a data property is [[Configurable]] attribute is true to a data property is
successful, 'O' is the global object successful, 'O' is the global object
includes: [propertyHelper.js, fnGlobalObject.js] includes: [propertyHelper.js]
---*/ ---*/
var obj = fnGlobalObject(); var obj = this;
obj.verifySetFunc = "data"; obj.verifySetFunc = "data";
var getFunc = function () { var getFunc = function () {

View File

@ -6,10 +6,9 @@ es5id: 15.2.3.3-4-10
description: > description: >
Object.getOwnPropertyDescriptor returns data desc for functions on Object.getOwnPropertyDescriptor returns data desc for functions on
built-ins (Global.decodeURIComponent) built-ins (Global.decodeURIComponent)
includes: [fnGlobalObject.js]
---*/ ---*/
var global = fnGlobalObject(); var global = this;
var desc = Object.getOwnPropertyDescriptor(global, "decodeURIComponent"); var desc = Object.getOwnPropertyDescriptor(global, "decodeURIComponent");
assert.sameValue(desc.value, global.decodeURIComponent, 'desc.value'); assert.sameValue(desc.value, global.decodeURIComponent, 'desc.value');

View File

@ -6,10 +6,9 @@ es5id: 15.2.3.3-4-11
description: > description: >
Object.getOwnPropertyDescriptor returns data desc for functions on Object.getOwnPropertyDescriptor returns data desc for functions on
built-ins (Global.encodeURIComponent) built-ins (Global.encodeURIComponent)
includes: [fnGlobalObject.js]
---*/ ---*/
var global = fnGlobalObject(); var global = this;
var desc = Object.getOwnPropertyDescriptor(global, "encodeURIComponent"); var desc = Object.getOwnPropertyDescriptor(global, "encodeURIComponent");
assert.sameValue(desc.value, global.encodeURIComponent, 'desc.value'); assert.sameValue(desc.value, global.encodeURIComponent, 'desc.value');

View File

@ -6,11 +6,10 @@ es5id: 15.2.3.3-4-178
description: > description: >
Object.getOwnPropertyDescriptor returns data desc (all false) for Object.getOwnPropertyDescriptor returns data desc (all false) for
properties on built-ins (Global.NaN) properties on built-ins (Global.NaN)
includes: [fnGlobalObject.js]
---*/ ---*/
// in non-strict mode, 'this' is bound to the global object. // in non-strict mode, 'this' is bound to the global object.
var desc = Object.getOwnPropertyDescriptor(fnGlobalObject(), "NaN"); var desc = Object.getOwnPropertyDescriptor(this, "NaN");
assert.sameValue(desc.writable, false, 'desc.writable'); assert.sameValue(desc.writable, false, 'desc.writable');
assert.sameValue(desc.enumerable, false, 'desc.enumerable'); assert.sameValue(desc.enumerable, false, 'desc.enumerable');

View File

@ -6,11 +6,10 @@ es5id: 15.2.3.3-4-179
description: > description: >
Object.getOwnPropertyDescriptor returns data desc (all false) for Object.getOwnPropertyDescriptor returns data desc (all false) for
properties on built-ins (Global.Infinity) properties on built-ins (Global.Infinity)
includes: [fnGlobalObject.js]
---*/ ---*/
// in non-strict mode, 'this' is bound to the global object. // in non-strict mode, 'this' is bound to the global object.
var desc = Object.getOwnPropertyDescriptor(fnGlobalObject(), "Infinity"); var desc = Object.getOwnPropertyDescriptor(this, "Infinity");
assert.sameValue(desc.writable, false, 'desc.writable'); assert.sameValue(desc.writable, false, 'desc.writable');
assert.sameValue(desc.enumerable, false, 'desc.enumerable'); assert.sameValue(desc.enumerable, false, 'desc.enumerable');

View File

@ -6,11 +6,10 @@ es5id: 15.2.3.3-4-180
description: > description: >
Object.getOwnPropertyDescriptor returns data desc (all false) for Object.getOwnPropertyDescriptor returns data desc (all false) for
properties on built-ins (Global.undefined) properties on built-ins (Global.undefined)
includes: [fnGlobalObject.js]
---*/ ---*/
// in non-strict mode, 'this' is bound to the global object. // in non-strict mode, 'this' is bound to the global object.
var desc = Object.getOwnPropertyDescriptor(fnGlobalObject(), "undefined"); var desc = Object.getOwnPropertyDescriptor(this, "undefined");
assert.sameValue(desc.writable, false, 'desc.writable'); assert.sameValue(desc.writable, false, 'desc.writable');
assert.sameValue(desc.enumerable, false, 'desc.enumerable'); assert.sameValue(desc.enumerable, false, 'desc.enumerable');

View File

@ -6,10 +6,9 @@ es5id: 15.2.3.3-4-4
description: > description: >
Object.getOwnPropertyDescriptor returns data desc for functions on Object.getOwnPropertyDescriptor returns data desc for functions on
built-ins (Global.eval) built-ins (Global.eval)
includes: [fnGlobalObject.js]
---*/ ---*/
var global = fnGlobalObject(); var global = this;
var desc = Object.getOwnPropertyDescriptor(global, "eval"); var desc = Object.getOwnPropertyDescriptor(global, "eval");
assert.sameValue(desc.value, global.eval, 'desc.value'); assert.sameValue(desc.value, global.eval, 'desc.value');

View File

@ -6,10 +6,9 @@ es5id: 15.2.3.3-4-5
description: > description: >
Object.getOwnPropertyDescriptor returns data desc for functions on Object.getOwnPropertyDescriptor returns data desc for functions on
built-ins (Global.parseInt) built-ins (Global.parseInt)
includes: [fnGlobalObject.js]
---*/ ---*/
var global = fnGlobalObject(); var global = this;
var desc = Object.getOwnPropertyDescriptor(global, "parseInt"); var desc = Object.getOwnPropertyDescriptor(global, "parseInt");
assert.sameValue(desc.value, global.parseInt, 'desc.value'); assert.sameValue(desc.value, global.parseInt, 'desc.value');

Some files were not shown because too many files have changed in this diff Show More