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

Unified Diff: test/mjsunit/harmony/set-prototype-of.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 | « src/objects.cc ('k') | test/mjsunit/proto-accessor.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/harmony/set-prototype-of.js
diff --git a/test/mjsunit/harmony/set-prototype-of.js b/test/mjsunit/harmony/set-prototype-of.js
index e06215a0edfcca65a84b4524f017c9805e856d22..e92a0c37bc3de9eb3b4750b0474581319061304e 100644
--- a/test/mjsunit/harmony/set-prototype-of.js
+++ b/test/mjsunit/harmony/set-prototype-of.js
@@ -139,6 +139,24 @@ function TestSetPrototypeOfNonExtensibleObject() {
TestSetPrototypeOfNonExtensibleObject();
+function TestSetPrototypeCyclic() {
+ 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.setPrototypeOf(object, value);
+ }, TypeError);
+ }
+}
+TestSetPrototypeCyclic();
+
+
function TestLookup() {
var object = {};
assertFalse('x' in object);
« no previous file with comments | « src/objects.cc ('k') | test/mjsunit/proto-accessor.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698