summaryrefslogtreecommitdiff
path: root/test/built-ins/Object/defineProperty/15.2.3.6-4-338.js
diff options
context:
space:
mode:
Diffstat (limited to 'test/built-ins/Object/defineProperty/15.2.3.6-4-338.js')
-rw-r--r--test/built-ins/Object/defineProperty/15.2.3.6-4-338.js16
1 files changed, 6 insertions, 10 deletions
diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-4-338.js b/test/built-ins/Object/defineProperty/15.2.3.6-4-338.js
index 38f563aa0..45425687a 100644
--- a/test/built-ins/Object/defineProperty/15.2.3.6-4-338.js
+++ b/test/built-ins/Object/defineProperty/15.2.3.6-4-338.js
@@ -7,10 +7,8 @@ description: >
ES5 Attributes - fail to update [[Configurable]] attribute of data
property ([[Writable]] is true, [[Enumerable]] is true,
[[Configurable]] is false) to different value
-includes: [runTestCase.js]
---*/
-function testcase() {
var obj = {};
Object.defineProperty(obj, "prop", {
@@ -21,15 +19,13 @@ function testcase() {
});
var propertyDefineCorrect = obj.hasOwnProperty("prop");
var desc1 = Object.getOwnPropertyDescriptor(obj, "prop");
-
- try {
+assert.throws(TypeError, function() {
Object.defineProperty(obj, "prop", {
configurable: true
});
- return false;
- } catch (e) {
+});
var desc2 = Object.getOwnPropertyDescriptor(obj, "prop");
- return propertyDefineCorrect && desc1.configurable === false && obj.prop === 2010 && desc2.configurable === false && e instanceof TypeError;
- }
- }
-runTestCase(testcase);
+assert(propertyDefineCorrect, 'propertyDefineCorrect !== true');
+assert.sameValue(desc1.configurable, false, 'desc1.configurable');
+assert.sameValue(obj.prop, 2010, 'obj.prop');
+assert.sameValue(desc2.configurable, false, 'desc2.configurable');