main
Last change
on this file since 79a0317 was 79a0317, checked in by stefan toskovski <stefantoska84@…>, 3 days ago |
F4 Finalna Verzija
|
-
Property mode
set to
100644
|
File size:
929 bytes
|
Line | |
---|
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.dispose` well-known symbol
|
---|
10 | // https://github.com/tc39/proposal-explicit-resource-management
|
---|
11 | defineWellKnownSymbol('dispose');
|
---|
12 |
|
---|
13 | if (Symbol) {
|
---|
14 | var descriptor = getOwnPropertyDescriptor(Symbol, 'dispose');
|
---|
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, 'dispose', { value: descriptor.value, enumerable: false, configurable: false, writable: false });
|
---|
20 | }
|
---|
21 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.