summaryrefslogtreecommitdiff
path: root/test/built-ins/Object/defineProperties/15.2.3.7-6-a-288.js
diff options
context:
space:
mode:
Diffstat (limited to 'test/built-ins/Object/defineProperties/15.2.3.7-6-a-288.js')
-rw-r--r--test/built-ins/Object/defineProperties/15.2.3.7-6-a-288.js60
1 files changed, 32 insertions, 28 deletions
diff --git a/test/built-ins/Object/defineProperties/15.2.3.7-6-a-288.js b/test/built-ins/Object/defineProperties/15.2.3.7-6-a-288.js
index 1c3e584d5..420cd3c83 100644
--- a/test/built-ins/Object/defineProperties/15.2.3.7-6-a-288.js
+++ b/test/built-ins/Object/defineProperties/15.2.3.7-6-a-288.js
@@ -12,39 +12,43 @@ description: >
of 'O', test TypeError is thrown when updating the [[Enumerable]]
attribute value of 'P' which is defined as non-configurable (10.6
[[DefineOwnProperty]] step 4)
-includes:
- - runTestCase.js
- - accessorPropertyAttributesAreCorrect.js
+includes: [propertyHelper.js]
---*/
-function testcase() {
- var arg;
+var arg;
- (function fun(a, b, c) {
- arg = arguments;
- }(0, 1, 2));
+(function fun(a, b, c) {
+ arg = arguments;
+}(0, 1, 2));
- function get_func() {
- return 0;
- }
+function get_func() {
+ return 0;
+}
+
+Object.defineProperty(arg, "0", {
+ get: get_func,
+ enumerable: true,
+ configurable: false
+});
- Object.defineProperty(arg, "0", {
- get: get_func,
- enumerable: true,
- configurable: false
- });
-
- try {
- Object.defineProperties(arg, {
- "0": {
- enumerable: false
- }
- });
-
- return false;
- } catch (e) {
- return (e instanceof TypeError) && accessorPropertyAttributesAreCorrect(arg, "0", get_func, undefined, undefined, true, false);
+try {
+ Object.defineProperties(arg, {
+ "0": {
+ enumerable: false
}
+ });
+
+ $ERROR("Expected an exception.");
+} catch (e) {
+ verifyEqualTo(arg, "0", get_func());
+
+ verifyEnumerable(arg, "0");
+
+ verifyNotConfigurable(arg, "0");
+
+ if (!(e instanceof TypeError)) {
+ $ERROR("Expected TypeError, got " + e);
}
-runTestCase(testcase);
+
+}