main
Last change
on this file was 79a0317, checked in by stefan toskovski <stefantoska84@…>, 4 days ago |
F4 Finalna Verzija
|
-
Property mode
set to
100644
|
File size:
955 bytes
|
Rev | Line | |
---|
[79a0317] | 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 |
|
---|
| 7 | var Symbol = globalThis.Symbol;
|
---|
| 8 |
|
---|
| 9 | // `Symbol.asyncDispose` well-known symbol
|
---|
| 10 | // https://github.com/tc39/proposal-async-explicit-resource-management
|
---|
| 11 | defineWellKnownSymbol('asyncDispose');
|
---|
| 12 |
|
---|
| 13 | if (Symbol) {
|
---|
| 14 | var descriptor = getOwnPropertyDescriptor(Symbol, 'asyncDispose');
|
---|
| 15 | // workaround of NodeJS 20.4 bug
|
---|
| 16 | // https://github.com/nodejs/node/issues/48699
|
---|
| 17 | // and incorrect descriptor from some transpilers and userland helpers
|
---|
| 18 | if (descriptor.enumerable && descriptor.configurable && descriptor.writable) {
|
---|
| 19 | defineProperty(Symbol, 'asyncDispose', { value: descriptor.value, enumerable: false, configurable: false, writable: false });
|
---|
| 20 | }
|
---|
| 21 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.