Index: test/mjsunit/object-define-property.js |
=================================================================== |
--- test/mjsunit/object-define-property.js (revision 6231) |
+++ test/mjsunit/object-define-property.js (working copy) |
@@ -749,33 +749,14 @@ |
assertTrue(desc.enumerable); |
assertFalse(desc.configurable); |
-// Can use defineProperty to change the value of a non |
-// configurable property. |
+// Ensure that we can't overwrite the non configurable element. |
try { |
Object.defineProperty(obj6, '2', descElement); |
- desc = Object.getOwnPropertyDescriptor(obj6, '2'); |
- assertEquals(desc.value, 'foobar'); |
-} catch (e) { |
assertUnreachable(); |
-} |
- |
-// Ensure that we can't change the descriptor of a |
-// non configurable property. |
-try { |
- var descAccessor = { get: function() { return 0; } }; |
- Object.defineProperty(obj6, '2', descAccessor); |
- assertUnreachable(); |
} catch (e) { |
assertTrue(/Cannot redefine property/.test(e)); |
} |
-Object.defineProperty(obj6, '2', descElementNonWritable); |
-desc = Object.getOwnPropertyDescriptor(obj6, '2'); |
-assertEquals(desc.value, 'foofoo'); |
-assertFalse(desc.writable); |
-assertTrue(desc.enumerable); |
-assertFalse(desc.configurable); |
- |
Object.defineProperty(obj6, '3', descElementNonWritable); |
desc = Object.getOwnPropertyDescriptor(obj6, '3'); |
assertEquals(desc.value, 'foofoo'); |
@@ -846,33 +827,14 @@ |
assertTrue(desc.enumerable); |
assertFalse(desc.configurable); |
-// Can use defineProperty to change the value of a non |
-// configurable property of an array. |
+// Ensure that we can't overwrite the non configurable element. |
try { |
Object.defineProperty(arr, '2', descElement); |
- desc = Object.getOwnPropertyDescriptor(arr, '2'); |
- assertEquals(desc.value, 'foobar'); |
-} catch (e) { |
assertUnreachable(); |
-} |
- |
-// Ensure that we can't change the descriptor of a |
-// non configurable property. |
-try { |
- var descAccessor = { get: function() { return 0; } }; |
- Object.defineProperty(arr, '2', descAccessor); |
- assertUnreachable(); |
} catch (e) { |
assertTrue(/Cannot redefine property/.test(e)); |
} |
-Object.defineProperty(arr, '2', descElementNonWritable); |
-desc = Object.getOwnPropertyDescriptor(arr, '2'); |
-assertEquals(desc.value, 'foofoo'); |
-assertFalse(desc.writable); |
-assertTrue(desc.enumerable); |
-assertFalse(desc.configurable); |
- |
Object.defineProperty(arr, '3', descElementNonWritable); |
desc = Object.getOwnPropertyDescriptor(arr, '3'); |
assertEquals(desc.value, 'foofoo'); |