summaryrefslogtreecommitdiff
path: root/test/built-ins/Object/defineProperty/15.2.3.6-4-245.js
diff options
context:
space:
mode:
Diffstat (limited to 'test/built-ins/Object/defineProperty/15.2.3.6-4-245.js')
-rw-r--r--test/built-ins/Object/defineProperty/15.2.3.6-4-245.js43
1 files changed, 24 insertions, 19 deletions
diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-4-245.js b/test/built-ins/Object/defineProperty/15.2.3.6-4-245.js
index 4db654f76..8a70e1d30 100644
--- a/test/built-ins/Object/defineProperty/15.2.3.6-4-245.js
+++ b/test/built-ins/Object/defineProperty/15.2.3.6-4-245.js
@@ -14,29 +14,34 @@ description: >
value of 'name' is false, and the type of the [[Value]] field of
'desc' is different from the type of the [[Value]] attribute value
of 'name' (15.4.5.1 step 4.c)
-includes:
- - runTestCase.js
- - dataPropertyAttributesAreCorrect.js
+includes: [propertyHelper.js]
---*/
-function testcase() {
- var arrObj = [];
+var arrObj = [];
- Object.defineProperty(arrObj, "1", {
- value: 3,
- writable: false,
- configurable: false
- });
+Object.defineProperty(arrObj, "1", {
+ value: 3,
+ writable: false,
+ configurable: false
+});
- try {
+try {
+ Object.defineProperty(arrObj, "1", {
+ value: "abc"
+ });
+ $ERROR("Expected an exception.");
+} catch (e) {
+ verifyEqualTo(arrObj, "1", 3);
- Object.defineProperty(arrObj, "1", {
- value: "abc"
- });
- return false;
- } catch (e) {
- return e instanceof TypeError && dataPropertyAttributesAreCorrect(arrObj, "1", 3, false, false, false);
- }
+ verifyNotWritable(arrObj, "1");
+
+ verifyNotEnumerable(arrObj, "1");
+
+ verifyNotConfigurable(arrObj, "1");
+
+ if (!(e instanceof TypeError)) {
+ $ERROR("Expected TypeError, got " + e);
}
-runTestCase(testcase);
+
+}