main
Last change
on this file was d24f17c, checked in by Aleksandar Panovski <apano77@…>, 15 months ago |
Initial commit
|
-
Property mode
set to
100644
|
File size:
829 bytes
|
Line | |
---|
1 | 'use strict';
|
---|
2 | var global = require('../internals/global');
|
---|
3 | var fails = require('../internals/fails');
|
---|
4 | var V8 = require('../internals/engine-v8-version');
|
---|
5 | var IS_BROWSER = require('../internals/engine-is-browser');
|
---|
6 | var IS_DENO = require('../internals/engine-is-deno');
|
---|
7 | var IS_NODE = require('../internals/engine-is-node');
|
---|
8 |
|
---|
9 | var structuredClone = global.structuredClone;
|
---|
10 |
|
---|
11 | module.exports = !!structuredClone && !fails(function () {
|
---|
12 | // prevent V8 ArrayBufferDetaching protector cell invalidation and performance degradation
|
---|
13 | // https://github.com/zloirock/core-js/issues/679
|
---|
14 | if ((IS_DENO && V8 > 92) || (IS_NODE && V8 > 94) || (IS_BROWSER && V8 > 97)) return false;
|
---|
15 | var buffer = new ArrayBuffer(8);
|
---|
16 | var clone = structuredClone(buffer, { transfer: [buffer] });
|
---|
17 | return buffer.byteLength !== 0 || clone.byteLength !== 8;
|
---|
18 | });
|
---|
Note:
See
TracBrowser
for help on using the repository browser.