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

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

Issue 1397853005: [es6] Partially implement Reflect.preventExtensions. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Sorry 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-scopes.cc ('k') | test/mjsunit/harmony/reflect-prevent-extensions.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 f34a1ed81b2502440b895355f7d9ec2f00c03596..613e898286c8adafa08fa5c9b8ef376bf8d51f1c 100644
--- a/test/mjsunit/harmony/reflect.js
+++ b/test/mjsunit/harmony/reflect.js
@@ -247,7 +247,7 @@ function prepare(tgt) {
(function testReflectIsExtensibleOnObject() {
- // This should be the last test as it modifies the objects irreversibly.
+ // This should be the last test on [objects] as it modifies them irreversibly.
for (let tgt of objects) {
prepare(tgt);
if (tgt instanceof Int32Array) continue; // issue v8:4460
@@ -276,3 +276,26 @@ function prepare(tgt) {
// See reflect-enumerate*.js for further tests.
+
+
+
+////////////////////////////////////////////////////////////////////////////////
+// Reflect.preventExtensions
+
+
+(function testReflectPreventExtensionsArity() {
+ assertEquals(1, Reflect.preventExtensions.length);
+})();
+
+
+(function testReflectPreventExtensionsOnNonObject() {
+ assertThrows(function() { Reflect.preventExtensions(); }, TypeError);
+ assertThrows(function() { Reflect.preventExtensions(42); }, TypeError);
+ assertThrows(function() { Reflect.preventExtensions(null); }, TypeError);
+})();
+
+
+// See reflect-prevent-extensions.js for further tests.
+
+// TODO(neis): Need proxies to test the situation where
+// [[preventExtensions]] returns false.
« no previous file with comments | « src/runtime/runtime-scopes.cc ('k') | test/mjsunit/harmony/reflect-prevent-extensions.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698