v8/test/mjsunit/es6/hasinstance-symbol.js
mvstanton d69ce04d03 Implement symbol @@hasInstance for ES6 instanceof support.
BUG=

Committed: https://crrev.com/5833e8e8a437cd66405784263ccc45e73470fd42
Cr-Commit-Position: refs/heads/master@{#33870}

Review URL: https://codereview.chromium.org/1683043003

Cr-Commit-Position: refs/heads/master@{#33890}
2016-02-11 11:59:22 +00:00

13 lines
435 B
JavaScript

// 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.
// Verify that the hasInstance symbol is installed on function prototype.
// Test262 makes deeper tests.
(function TestHasInstance() {
var a = Array();
assertTrue(Array[Symbol.hasInstance](a));
assertFalse(Function.prototype[Symbol.hasInstance].call());
})();