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 |
|
13 |
|
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 | });
|