main
Last change
on this file was 79a0317, checked in by stefan toskovski <stefantoska84@…>, 3 days ago |
F4 Finalna Verzija
|
-
Property mode
set to
100644
|
File size:
779 bytes
|
Line | |
---|
1 | 'use strict';
|
---|
2 | var globalThis = require('../internals/global-this');
|
---|
3 | var fails = require('../internals/fails');
|
---|
4 | var V8 = require('../internals/environment-v8-version');
|
---|
5 | var ENVIRONMENT = require('../internals/environment');
|
---|
6 |
|
---|
7 | var structuredClone = globalThis.structuredClone;
|
---|
8 |
|
---|
9 | module.exports = !!structuredClone && !fails(function () {
|
---|
10 | // prevent V8 ArrayBufferDetaching protector cell invalidation and performance degradation
|
---|
11 | // https://github.com/zloirock/core-js/issues/679
|
---|
12 | if ((ENVIRONMENT === 'DENO' && V8 > 92) || (ENVIRONMENT === 'NODE' && V8 > 94) || (ENVIRONMENT === 'BROWSER' && V8 > 97)) return false;
|
---|
13 | var buffer = new ArrayBuffer(8);
|
---|
14 | var clone = structuredClone(buffer, { transfer: [buffer] });
|
---|
15 | return buffer.byteLength !== 0 || clone.byteLength !== 8;
|
---|
16 | });
|
---|
Note:
See
TracBrowser
for help on using the repository browser.