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.

esnext.symbol.async-dispose.js 955B

123456789101112131415161718192021
  1. 'use strict';
  2. var globalThis = require('../internals/global-this');
  3. var defineWellKnownSymbol = require('../internals/well-known-symbol-define');
  4. var defineProperty = require('../internals/object-define-property').f;
  5. var getOwnPropertyDescriptor = require('../internals/object-get-own-property-descriptor').f;
  6. var Symbol = globalThis.Symbol;
  7. // `Symbol.asyncDispose` well-known symbol
  8. // https://github.com/tc39/proposal-async-explicit-resource-management
  9. defineWellKnownSymbol('asyncDispose');
  10. if (Symbol) {
  11. var descriptor = getOwnPropertyDescriptor(Symbol, 'asyncDispose');
  12. // workaround of NodeJS 20.4 bug
  13. // https://github.com/nodejs/node/issues/48699
  14. // and incorrect descriptor from some transpilers and userland helpers
  15. if (descriptor.enumerable && descriptor.configurable && descriptor.writable) {
  16. defineProperty(Symbol, 'asyncDispose', { value: descriptor.value, enumerable: false, configurable: false, writable: false });
  17. }
  18. }