summaryrefslogtreecommitdiff
path: root/test/built-ins/Object/defineProperties/15.2.3.7-6-a-108.js
diff options
context:
space:
mode:
authorsmikes <smikes@cubane.com>2014-11-12 06:41:09 -0700
committerBrian Terlson <brian.terlson@microsoft.com>2014-12-10 17:39:16 -0800
commit49abae4f5e6b38931d86dc9b9d34ae30d9ced2ca (patch)
tree74717e0a06067a09fd49d8ffca5048c87338d467 /test/built-ins/Object/defineProperties/15.2.3.7-6-a-108.js
parent5318ee7b1f1da93977baa153aaa62f96af70bd37 (diff)
downloadqtdeclarative-testsuites-49abae4f5e6b38931d86dc9b9d34ae30d9ced2ca.tar.gz
rework: remove *PropertyAttributes fns
- this change hits all files that use dataPropertyAttributesAreCorrect or acccessorPropertyAttributesAreCorrect Major changes: - remove include of runTestCase.js, dataPropertyAttributesAreCorrect.js and acccessorPropertyAttributesAreCorrect.js - add include of propertyHelper.js - remove function testCase() and call to function runTestCase() - instead of collecting test state into booleans, which are eventually returned from runTestCase, test conditions and throw errors immediately - use negative: to check error types instead of using `instanceof` in a catch() block Selected commit logs follow: manual conversion of accessorPropertyAttributesAreCorrect() test - remove runTestCase - remove wrapping testCase function - unindent - remove includes of runTestCase & accessor... - add include of propertyHelper.js - unpack final two args 'true, false' to explicit inline tests of isEnumerable and isConfigurable - unpack setter test into inline logic - unpack getter test into inline logic used script to replace includes: frontmatter with propertyHelper.js ; manually added back references to fnGlobalObject() where needed additional helper functions add helper functions for get and writable duplicate runTestCase so can remove runTestCase.js from includes of all tests in batch use keyboard macros to simplify repetitive conversions remove auto-save file accidentaly committed minor changes, manually remove runTestCase from remaining files lint etc. fixes remove now-obsolete harness files make strict/nonstrict variants tests where behavior is different in strict/nonstrict need two variants - strict mode throws on assign to read-only element (no setter fn) - strict mode separates named arguments from arguments[] fix indentation cleanup minor issues reviewing 15.2.3.7-9 tests, found some minor issues - indentation/spacing - duplicate test (eg, direct test of value and dataProp...) - remove needless try/finally - use assert.. helpers in place of if(is.. - rename some assertions to 'e' rename assertX to verifyX new helper fn sameValue test "set" as well as get reverse order of checks restore test of desc2 restore test of length restore test of ownProperty incorporate suggestions re order of ops, Object.prototype add test of sameValue helper restore return value in getter restore second defineProperty call restore check of explicit "false" restore explicit test of TypeError set noStrict flag on arguments changes rename catch var to "e" b4ad0e6 remove dataPropertyAttributesAreCorrect from tests 0d83ff2 remove accessorPropertyAttributesAreCorrect from tests bb926f3 remove {data,accessor}Property... fns from harness fix writable check on array.length call $ERROR if expected exception not thrown fix Epected => Expected typo use assert._isSamevalue
Diffstat (limited to 'test/built-ins/Object/defineProperties/15.2.3.7-6-a-108.js')
-rw-r--r--test/built-ins/Object/defineProperties/15.2.3.7-6-a-108.js57
1 files changed, 29 insertions, 28 deletions
diff --git a/test/built-ins/Object/defineProperties/15.2.3.7-6-a-108.js b/test/built-ins/Object/defineProperties/15.2.3.7-6-a-108.js
index 7218d10ec..75a7f95af 100644
--- a/test/built-ins/Object/defineProperties/15.2.3.7-6-a-108.js
+++ b/test/built-ins/Object/defineProperties/15.2.3.7-6-a-108.js
@@ -9,34 +9,35 @@ es5id: 15.2.3.7-6-a-108
description: >
Object.defineProperties - 'P' is accessor property, P.configurable
is true and properties.configurable is false
-includes:
- - runTestCase.js
- - accessorPropertyAttributesAreCorrect.js
+includes: [propertyHelper.js]
---*/
-function testcase() {
-
- var obj = {};
-
- function get_func() {
- return 10;
- }
- function set_func(value) {
- obj.setVerifyHelpProp = value;
- }
-
- Object.defineProperty(obj, "foo", {
- get: get_func,
- set: set_func,
- enumerable: true,
- configurable: true
- });
-
- Object.defineProperties(obj, {
- foo: {
- configurable: false
- }
- });
- return accessorPropertyAttributesAreCorrect(obj, "foo", get_func, set_func, "setVerifyHelpProp", true, false);
+
+var obj = {};
+
+function get_func() {
+ return 10;
+}
+function set_func(value) {
+ obj.setVerifyHelpProp = value;
+}
+
+Object.defineProperty(obj, "foo", {
+ get: get_func,
+ set: set_func,
+ enumerable: true,
+ configurable: true
+});
+
+Object.defineProperties(obj, {
+ foo: {
+ configurable: false
}
-runTestCase(testcase);
+});
+verifyEqualTo(obj, "foo", get_func());
+
+verifyWritable(obj, "foo", "setVerifyHelpProp");
+
+verifyEnumerable(obj, "foo");
+
+verifyNotConfigurable(obj, "foo");