Chromium Code Reviews

Unified Diff: test/mjsunit/regress/regress-192.js

Issue 6118001: Avoid calling inherited setters when creating object literals and their boilerplates. (Closed)
Patch Set: Created 9 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
« src/handles.cc ('K') | « test/mjsunit/regress/regress-1015.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/regress/regress-192.js
diff --git a/test/mjsunit/regress/regress-192.js b/test/mjsunit/regress/regress-192.js
index 8f0978f1b6e798d9a69f1cde9c4455720dd4f4ef..a8e5e9da3305f19c0a73d319d77d388c0f0d31f1 100644
--- a/test/mjsunit/regress/regress-192.js
+++ b/test/mjsunit/regress/regress-192.js
@@ -30,9 +30,16 @@
// See http://code.google.com/p/v8/issues/detail?id=192
+// UPDATE: This bug report is no longer valid. In ES5, creating object
+// literals MUST NOT trigger inherited accessors, but act as if creating
+// the properties using DefineOwnProperty.
+
Object.prototype.__defineGetter__("x", function() {});
+Object.prototype.__defineSetter__("y",
+ function() { assertUnreachable("setter"); });
-// Creating this object literal will throw an exception because we are
+// Creating this object literal will *not* throw an exception because we are
// assigning to a property that has only a getter.
-assertThrows("({ x: 42 })");
-
+var x = ({ x: 42, y: 37 });
+assertEquals(42, x.x);
+assertEquals(37, x.y);
« src/handles.cc ('K') | « test/mjsunit/regress/regress-1015.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine