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

Unified Diff: test/mjsunit/harmony/instanceof-es6.js

Issue 2096933002: Remove all harmony runtime flags which shipped in M51 (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Review comments Created 4 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 | « test/mjsunit/harmony/function-name.js ('k') | test/mjsunit/harmony/iterator-close.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/harmony/instanceof-es6.js
diff --git a/test/mjsunit/harmony/instanceof-es6.js b/test/mjsunit/harmony/instanceof-es6.js
deleted file mode 100644
index 4971c9c76b782025373e2b0d7020cc217dabedb7..0000000000000000000000000000000000000000
--- a/test/mjsunit/harmony/instanceof-es6.js
+++ /dev/null
@@ -1,69 +0,0 @@
-// Copyright 2016 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-// Flags: --harmony-instanceof
-
-// Make sure it's an error if @@hasInstance isn't a function.
-(function() {
- var F = {};
- F[Symbol.hasInstance] = null;
- assertThrows(function() { 0 instanceof F; }, TypeError);
-})();
-
-// Make sure the result is coerced to boolean.
-(function() {
- var F = {};
- F[Symbol.hasInstance] = function() { return undefined; };
- assertEquals(0 instanceof F, false);
- F[Symbol.hasInstance] = function() { return null; };
- assertEquals(0 instanceof F, false);
- F[Symbol.hasInstance] = function() { return true; };
- assertEquals(0 instanceof F, true);
-})();
-
-// Make sure if @@hasInstance throws, we catch it.
-(function() {
- var F = {};
- F[Symbol.hasInstance] = function() { throw new Error("always throws"); }
- try {
- 0 instanceof F;
- } catch (e) {
- assertEquals(e.message, "always throws");
- }
-})();
-
-// @@hasInstance works for bound functions.
-(function() {
- var BC = function() {};
- var bc = new BC();
- var bound = BC.bind();
- assertEquals(bound[Symbol.hasInstance](bc), true);
- assertEquals(bound[Symbol.hasInstance]([]), false);
-})();
-
-// if OrdinaryHasInstance is passed a non-callable receiver, return false.
-assertEquals(Function.prototype[Symbol.hasInstance].call(Array, []), true);
-assertEquals(Function.prototype[Symbol.hasInstance].call({}, {}), false);
-
-// OrdinaryHasInstance passed a non-object argument returns false.
-assertEquals(Function.prototype[Symbol.hasInstance].call(Array, 0), false);
-
-// Cannot assign to @@hasInstance with %FunctionPrototype%.
-(function() {
- "use strict";
- function F() {}
- assertThrows(function() { F[Symbol.hasInstance] = (v) => v }, TypeError);
-})();
-
-// Check correct invocation of @@hasInstance handler on function instance.
-(function() {
- function F() {}
- var counter = 0;
- var proto = Object.getPrototypeOf(F);
- Object.setPrototypeOf(F, null);
- F[Symbol.hasInstance] = function(v) { ++counter; return true };
- Object.setPrototypeOf(F, proto);
- assertTrue(1 instanceof F);
- assertEquals(1, counter);
-})();
« no previous file with comments | « test/mjsunit/harmony/function-name.js ('k') | test/mjsunit/harmony/iterator-close.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698