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

Unified Diff: test/mjsunit/harmony/reflect.js

Issue 1417243002: [es6] Partially implement Reflect.setPrototypeOf. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 2 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/runtime/runtime-object.cc ('k') | test/mjsunit/harmony/reflect-set-prototype-of.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/harmony/reflect.js
diff --git a/test/mjsunit/harmony/reflect.js b/test/mjsunit/harmony/reflect.js
index 84709ba0cf8ed506e97a02376c235d2ff0954790..73d0115db916f3d7041ae3333d7dc9f059e09220 100644
--- a/test/mjsunit/harmony/reflect.js
+++ b/test/mjsunit/harmony/reflect.js
@@ -239,7 +239,7 @@ function prepare(tgt) {
})();
-(function testReflectDeletePropertyOnNonObject() {
+(function testReflectGetPrototypeOnNonObject() {
assertThrows(function() { Reflect.getPrototypeOf(); }, TypeError);
assertThrows(function() { Reflect.getPrototypeOf(42); }, TypeError);
assertThrows(function() { Reflect.getPrototypeOf(null); }, TypeError);
@@ -251,6 +251,32 @@ function prepare(tgt) {
////////////////////////////////////////////////////////////////////////////////
+// Reflect.setPrototypeOf
+
+
+(function testReflectSetPrototypeOfArity() {
+ assertEquals(2, Reflect.setPrototypeOf.length);
+})();
+
+
+(function testReflectSetPrototypeOfOnNonObject() {
+ assertThrows(function() { Reflect.setPrototypeOf(undefined, {}); },
+ TypeError);
+ assertThrows(function() { Reflect.setPrototypeOf(42, {}); }, TypeError);
+ assertThrows(function() { Reflect.setPrototypeOf(null, {}); }, TypeError);
+
+ assertThrows(function() { Reflect.setPrototypeOf({}, undefined); },
+ TypeError);
+ assertThrows(function() { Reflect.setPrototypeOf({}, 42); }, TypeError);
+ assertTrue(Reflect.setPrototypeOf({}, null));
+})();
+
+
+// See reflect-set-prototype-of.js for further tests.
+
+
+
+////////////////////////////////////////////////////////////////////////////////
// Reflect.isExtensible
« no previous file with comments | « src/runtime/runtime-object.cc ('k') | test/mjsunit/harmony/reflect-set-prototype-of.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698