Node-Red configuration
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.

structured-clone-proper-transfer.js 779B

12345678910111213141516
  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. var structuredClone = globalThis.structuredClone;
  7. module.exports = !!structuredClone && !fails(function () {
  8. // prevent V8 ArrayBufferDetaching protector cell invalidation and performance degradation
  9. // https://github.com/zloirock/core-js/issues/679
  10. if ((ENVIRONMENT === 'DENO' && V8 > 92) || (ENVIRONMENT === 'NODE' && V8 > 94) || (ENVIRONMENT === 'BROWSER' && V8 > 97)) return false;
  11. var buffer = new ArrayBuffer(8);
  12. var clone = structuredClone(buffer, { transfer: [buffer] });
  13. return buffer.byteLength !== 0 || clone.byteLength !== 8;
  14. });