summaryrefslogtreecommitdiff
path: root/test/built-ins/Object/defineProperty/15.2.3.6-4-317-1.js
diff options
context:
space:
mode:
Diffstat (limited to 'test/built-ins/Object/defineProperty/15.2.3.6-4-317-1.js')
-rw-r--r--test/built-ins/Object/defineProperty/15.2.3.6-4-317-1.js52
1 files changed, 30 insertions, 22 deletions
diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-4-317-1.js b/test/built-ins/Object/defineProperty/15.2.3.6-4-317-1.js
index 67f92c911..a518f7efb 100644
--- a/test/built-ins/Object/defineProperty/15.2.3.6-4-317-1.js
+++ b/test/built-ins/Object/defineProperty/15.2.3.6-4-317-1.js
@@ -12,28 +12,36 @@ description: >
TypeError is thrown when updating the [[Value]] attribute value of
'P' which is not writable and not configurable (10.6
[[DefineOwnProperty]] step 4)
-includes:
- - runTestCase.js
- - dataPropertyAttributesAreCorrect.js
+includes: [propertyHelper.js]
---*/
-function testcase() {
- return (function (a, b, c) {
- Object.defineProperty(arguments, "genericProperty", {
- value: 1001,
- writable: false,
- configurable: false
- });
- try {
- Object.defineProperty(arguments, "genericProperty", {
- value: 1002
- });
- } catch (e) {
- var verifyFormal = b === 2;
- return e instanceof TypeError &&
- dataPropertyAttributesAreCorrect(arguments, "genericProperty", 1001, false, false, false) && verifyFormal;
- }
- return false;
- }(1, 2, 3));
+(function (a, b, c) {
+ Object.defineProperty(arguments, "genericProperty", {
+ value: 1001,
+ writable: false,
+ configurable: false
+ });
+ try {
+ Object.defineProperty(arguments, "genericProperty", {
+ value: 1002
+ });
+ $ERROR("Expected an exception.");
+ } catch (e) {
+ if (b !== 2) {
+ $ERROR('Expected "b === 2;", actually ' + b);
+ }
+
+ verifyEqualTo(arguments, "genericProperty", 1001);
+
+ verifyNotWritable(arguments, "genericProperty");
+
+ verifyNotEnumerable(arguments, "genericProperty");
+
+ verifyNotConfigurable(arguments, "genericProperty");
+
+ if (!(e instanceof TypeError)) {
+ $ERROR("Expected TypeError, got " + e);
+ }
+
}
-runTestCase(testcase);
+}(1, 2, 3));