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

Unified Diff: test/mjsunit/proto-accessor.js

Issue 1198523002: [es6] throw TypeError when setting cyclic prototype value (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix webkit failure Created 5 years, 6 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 | « test/mjsunit/harmony/set-prototype-of.js ('k') | test/webkit/cyclic-prototypes-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/proto-accessor.js
diff --git a/test/mjsunit/proto-accessor.js b/test/mjsunit/proto-accessor.js
index 513a044023e9db5d74449f5f4d46fb02a74ff571..690b10b5f13976e6a4a7c36331e6c9e1a5559ab0 100644
--- a/test/mjsunit/proto-accessor.js
+++ b/test/mjsunit/proto-accessor.js
@@ -29,6 +29,24 @@
this.Symbol = typeof Symbol != 'undefined' ? Symbol : String;
+function TestSetProtoValueCyclic() {
+ var objects = [
+ Object.prototype, {},
+ Array.prototype, [],
+ Error.prototype, new TypeError,
+ // etc ...
+ ];
+ for (var i = 0; i < objects.length; i += 2) {
+ var object = objects[i];
+ var value = objects[i + 1];
+ assertThrows(function() {
+ object.__proto__ = value;
+ }, TypeError);
+ }
+};
+TestSetProtoValueCyclic();
+
+
var desc = Object.getOwnPropertyDescriptor(Object.prototype, "__proto__");
var getProto = desc.get;
var setProto = desc.set;
« no previous file with comments | « test/mjsunit/harmony/set-prototype-of.js ('k') | test/webkit/cyclic-prototypes-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698