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; |