summaryrefslogtreecommitdiff
path: root/test/built-ins/Object/defineProperty/15.2.3.6-4-241.js
diff options
context:
space:
mode:
Diffstat (limited to 'test/built-ins/Object/defineProperty/15.2.3.6-4-241.js')
-rw-r--r--test/built-ins/Object/defineProperty/15.2.3.6-4-241.js42
1 files changed, 24 insertions, 18 deletions
diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-4-241.js b/test/built-ins/Object/defineProperty/15.2.3.6-4-241.js
index b09ad9e87..63556e2b2 100644
--- a/test/built-ins/Object/defineProperty/15.2.3.6-4-241.js
+++ b/test/built-ins/Object/defineProperty/15.2.3.6-4-241.js
@@ -11,28 +11,34 @@ description: >
named property, TypeError is thrown if 'name' is data property,
and'desc' is accessor descriptor, and the [[Configurable]]
attribute value of 'name' is false (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,
- configurable: false
- });
+Object.defineProperty(arrObj, "1", {
+ value: 3,
+ configurable: false
+});
- try {
- Object.defineProperty(arrObj, "1", {
- set: function () { }
- });
- return false;
+try {
+ Object.defineProperty(arrObj, "1", {
+ set: function () { }
+ });
+ $ERROR("Expected an exception.");
- } catch (e) {
- return e instanceof TypeError && dataPropertyAttributesAreCorrect(arrObj, "1", 3, false, false, false);
- }
+} catch (e) {
+ verifyEqualTo(arrObj, "1", 3);
+
+ verifyNotWritable(arrObj, "1");
+
+ verifyNotEnumerable(arrObj, "1");
+
+ verifyNotConfigurable(arrObj, "1");
+
+ if (!(e instanceof TypeError)) {
+ $ERROR("Expected TypeError, got " + e);
}
-runTestCase(testcase);
+
+}