Last change
on this file was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago |
initial commit
|
-
Property mode
set to
100644
|
File size:
673 bytes
|
Line | |
---|
1 | var fails = require('../internals/fails');
|
---|
2 | var wellKnownSymbol = require('../internals/well-known-symbol');
|
---|
3 | var V8_VERSION = require('../internals/engine-v8-version');
|
---|
4 |
|
---|
5 | var SPECIES = wellKnownSymbol('species');
|
---|
6 |
|
---|
7 | module.exports = function (METHOD_NAME) {
|
---|
8 | // We can't use this feature detection in V8 since it causes
|
---|
9 | // deoptimization and serious performance degradation
|
---|
10 | // https://github.com/zloirock/core-js/issues/677
|
---|
11 | return V8_VERSION >= 51 || !fails(function () {
|
---|
12 | var array = [];
|
---|
13 | var constructor = array.constructor = {};
|
---|
14 | constructor[SPECIES] = function () {
|
---|
15 | return { foo: 1 };
|
---|
16 | };
|
---|
17 | return array[METHOD_NAME](Boolean).foo !== 1;
|
---|
18 | });
|
---|
19 | };
|
---|
Note:
See
TracBrowser
for help on using the repository browser.