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

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: 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') | no next file » | 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..c786f5420f93648475e367ac08bcddab064824c0 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);
mike4 2015/06/19 16:43:12 How about a second assertion for `object.__proto__
caitp (gmail) 2015/06/19 17:05:36 Done.
+ }, TypeError);
+ }
+}
+TestSetPrototypeCyclic();
+
+
function TestLookup() {
var object = {};
assertFalse('x' in object);
« no previous file with comments | « src/objects.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698