summaryrefslogtreecommitdiff
path: root/test/built-ins/Object/create
diff options
context:
space:
mode:
authorMike Pennisi <mike@mikepennisi.com>2016-04-22 13:07:00 -0400
committerGorkem Yakin <goyakin@microsoft.com>2016-04-25 11:09:21 -0700
commiteb644bb2da80a294282c4d98ad6fdef0bde5562f (patch)
treeda0ff0882600854fb373bda83fc2f3780361e206 /test/built-ins/Object/create
parent9aa4dced8d8afbe114b16650187ebb14c3e21e01 (diff)
downloadqtdeclarative-testsuites-eb644bb2da80a294282c4d98ad6fdef0bde5562f.tar.gz
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).
Diffstat (limited to 'test/built-ins/Object/create')
-rw-r--r--test/built-ins/Object/create/15.2.3.5-4-124.js5
-rw-r--r--test/built-ins/Object/create/15.2.3.5-4-149.js3
-rw-r--r--test/built-ins/Object/create/15.2.3.5-4-177.js5
-rw-r--r--test/built-ins/Object/create/15.2.3.5-4-203.js5
-rw-r--r--test/built-ins/Object/create/15.2.3.5-4-228.js3
-rw-r--r--test/built-ins/Object/create/15.2.3.5-4-256.js5
-rw-r--r--test/built-ins/Object/create/15.2.3.5-4-291.js5
-rw-r--r--test/built-ins/Object/create/15.2.3.5-4-300.js4
-rw-r--r--test/built-ins/Object/create/15.2.3.5-4-71.js5
-rw-r--r--test/built-ins/Object/create/15.2.3.5-4-96.js3
10 files changed, 17 insertions, 26 deletions
diff --git a/test/built-ins/Object/create/15.2.3.5-4-124.js b/test/built-ins/Object/create/15.2.3.5-4-124.js
index d22aee94f..664fdd276 100644
--- a/test/built-ins/Object/create/15.2.3.5-4-124.js
+++ b/test/built-ins/Object/create/15.2.3.5-4-124.js
@@ -7,13 +7,12 @@ description: >
Object.create - one property in 'Properties' is the global object
that uses Object's [[Get]] method to access the 'configurable'
property (8.10.5 step 4.a)
-includes: [fnGlobalObject.js]
---*/
- fnGlobalObject().configurable = true;
+ this.configurable = true;
var newObj = Object.create({}, {
- prop: fnGlobalObject()
+ prop: this
});
var result1 = newObj.hasOwnProperty("prop");
diff --git a/test/built-ins/Object/create/15.2.3.5-4-149.js b/test/built-ins/Object/create/15.2.3.5-4-149.js
index 9b590ff55..d5b9cd927 100644
--- a/test/built-ins/Object/create/15.2.3.5-4-149.js
+++ b/test/built-ins/Object/create/15.2.3.5-4-149.js
@@ -6,12 +6,11 @@ es5id: 15.2.3.5-4-149
description: >
Object.create - 'configurable' property of one property in
'Properties' is the global object (8.10.5 step 4.b)
-includes: [fnGlobalObject.js]
---*/
var newObj = Object.create({}, {
prop: {
- configurable: fnGlobalObject()
+ configurable: this
}
});
diff --git a/test/built-ins/Object/create/15.2.3.5-4-177.js b/test/built-ins/Object/create/15.2.3.5-4-177.js
index d9e835efb..58825c2a8 100644
--- a/test/built-ins/Object/create/15.2.3.5-4-177.js
+++ b/test/built-ins/Object/create/15.2.3.5-4-177.js
@@ -7,13 +7,12 @@ description: >
Object.create - one property in 'Properties' is the global object
that uses Object's [[Get]] method to access the 'value' property
(8.10.5 step 5.a)
-includes: [fnGlobalObject.js]
---*/
- fnGlobalObject().value = "GlobalValue";
+ this.value = "GlobalValue";
var newObj = Object.create({}, {
- prop: fnGlobalObject()
+ prop: this
});
assert.sameValue(newObj.prop, "GlobalValue", 'newObj.prop');
diff --git a/test/built-ins/Object/create/15.2.3.5-4-203.js b/test/built-ins/Object/create/15.2.3.5-4-203.js
index 013ecb214..2dd103625 100644
--- a/test/built-ins/Object/create/15.2.3.5-4-203.js
+++ b/test/built-ins/Object/create/15.2.3.5-4-203.js
@@ -7,13 +7,12 @@ description: >
Object.create - one property in 'Properties' is the global object
that uses Object's [[Get]] method to access the 'writable'
property (8.10.5 step 6.a)
-includes: [fnGlobalObject.js]
---*/
- fnGlobalObject().writable = true;
+ this.writable = true;
var newObj = Object.create({}, {
- prop: fnGlobalObject()
+ prop: this
});
var beforeWrite = (newObj.hasOwnProperty("prop") && typeof (newObj.prop) === "undefined");
diff --git a/test/built-ins/Object/create/15.2.3.5-4-228.js b/test/built-ins/Object/create/15.2.3.5-4-228.js
index 7adb830f1..6b8ffee24 100644
--- a/test/built-ins/Object/create/15.2.3.5-4-228.js
+++ b/test/built-ins/Object/create/15.2.3.5-4-228.js
@@ -6,12 +6,11 @@ es5id: 15.2.3.5-4-228
description: >
Object.create - 'writable' property of one property in
'Properties' is the global object (8.10.5 step 6.b)
-includes: [fnGlobalObject.js]
---*/
var newObj = Object.create({}, {
prop: {
- writable: fnGlobalObject()
+ writable: this
}
});
var hasProperty = newObj.hasOwnProperty("prop");
diff --git a/test/built-ins/Object/create/15.2.3.5-4-256.js b/test/built-ins/Object/create/15.2.3.5-4-256.js
index 6f35538fe..1fb8acfc8 100644
--- a/test/built-ins/Object/create/15.2.3.5-4-256.js
+++ b/test/built-ins/Object/create/15.2.3.5-4-256.js
@@ -7,15 +7,14 @@ description: >
Object.create - one property in 'Properties' is the global object
that uses Object's [[Get]] method to access the 'get' property
(8.10.5 step 7.a)
-includes: [fnGlobalObject.js]
---*/
- fnGlobalObject().get = function () {
+ this.get = function () {
return "VerifyGlobalObject";
};
var newObj = Object.create({}, {
- prop: fnGlobalObject()
+ prop: this
});
assert.sameValue(newObj.prop, "VerifyGlobalObject", 'newObj.prop');
diff --git a/test/built-ins/Object/create/15.2.3.5-4-291.js b/test/built-ins/Object/create/15.2.3.5-4-291.js
index b5d8d69e6..b412aa9d0 100644
--- a/test/built-ins/Object/create/15.2.3.5-4-291.js
+++ b/test/built-ins/Object/create/15.2.3.5-4-291.js
@@ -7,17 +7,16 @@ description: >
Object.create - one property in 'Properties' is the global object
that uses Object's [[Get]] method to access the 'set' property
(8.10.5 step 8.a)
-includes: [fnGlobalObject.js]
---*/
var data = "data";
- fnGlobalObject().set = function (value) {
+ this.set = function (value) {
data = value;
};
var newObj = Object.create({}, {
- prop: fnGlobalObject()
+ prop: this
});
var hasProperty = newObj.hasOwnProperty("prop");
diff --git a/test/built-ins/Object/create/15.2.3.5-4-300.js b/test/built-ins/Object/create/15.2.3.5-4-300.js
index d9557fc3d..4e350f9e7 100644
--- a/test/built-ins/Object/create/15.2.3.5-4-300.js
+++ b/test/built-ins/Object/create/15.2.3.5-4-300.js
@@ -6,14 +6,14 @@ es5id: 15.2.3.5-4-300
description: >
Object.create - 'set' property of one property in 'Properties' is
a host object that isn't callable (8.10.5 step 8.b)
-includes: [fnGlobalObject.js]
---*/
+var global = this;
assert.throws(TypeError, function() {
Object.create({}, {
prop: {
- set: fnGlobalObject()
+ set: global
}
});
});
diff --git a/test/built-ins/Object/create/15.2.3.5-4-71.js b/test/built-ins/Object/create/15.2.3.5-4-71.js
index 9d7dc1fcc..2d6ecb8dd 100644
--- a/test/built-ins/Object/create/15.2.3.5-4-71.js
+++ b/test/built-ins/Object/create/15.2.3.5-4-71.js
@@ -7,15 +7,14 @@ description: >
Object.create - one property in 'Properties' is the global object
that uses Object's [[Get]] method to access the 'enumerable'
property (8.10.5 step 3.a)
-includes: [fnGlobalObject.js]
---*/
var accessed = false;
- fnGlobalObject().enumerable = true;
+ this.enumerable = true;
var newObj = Object.create({}, {
- prop: fnGlobalObject()
+ prop: this
});
for (var property in newObj) {
if (property === "prop") {
diff --git a/test/built-ins/Object/create/15.2.3.5-4-96.js b/test/built-ins/Object/create/15.2.3.5-4-96.js
index c380a4bc2..8250c6f28 100644
--- a/test/built-ins/Object/create/15.2.3.5-4-96.js
+++ b/test/built-ins/Object/create/15.2.3.5-4-96.js
@@ -6,14 +6,13 @@ es5id: 15.2.3.5-4-96
description: >
Object.create - 'enumerable' property of one property in
'Properties' is the global object (8.10.5 step 3.b)
-includes: [fnGlobalObject.js]
---*/
var accessed = false;
var newObj = Object.create({}, {
prop: {
- enumerable: fnGlobalObject()
+ enumerable: this
}
});
for (var property in newObj) {