You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
19 lines
829 B
19 lines
829 B
5 months ago
|
'use strict';
|
||
|
var global = require('../internals/global');
|
||
|
var fails = require('../internals/fails');
|
||
|
var V8 = require('../internals/engine-v8-version');
|
||
|
var IS_BROWSER = require('../internals/engine-is-browser');
|
||
|
var IS_DENO = require('../internals/engine-is-deno');
|
||
|
var IS_NODE = require('../internals/engine-is-node');
|
||
|
|
||
|
var structuredClone = global.structuredClone;
|
||
|
|
||
|
module.exports = !!structuredClone && !fails(function () {
|
||
|
// prevent V8 ArrayBufferDetaching protector cell invalidation and performance degradation
|
||
|
// https://github.com/zloirock/core-js/issues/679
|
||
|
if ((IS_DENO && V8 > 92) || (IS_NODE && V8 > 94) || (IS_BROWSER && V8 > 97)) return false;
|
||
|
var buffer = new ArrayBuffer(8);
|
||
|
var clone = structuredClone(buffer, { transfer: [buffer] });
|
||
|
return buffer.byteLength !== 0 || clone.byteLength !== 8;
|
||
|
});
|