Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(668)

Unified Diff: test/mjsunit/object-define-property.js

Issue 6134005: Revert 6220 (generic descriptor support in Object.defineOwnProperty)... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 9 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/v8natives.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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');
« no previous file with comments | « src/v8natives.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698