-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix incorrect
Symbol.{ dispose, asyncDispose }
descriptors from Nod…
…eJS 20.4 / transpilers helpers / userland code
- Loading branch information
Showing
9 changed files
with
56 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 6 additions & 0 deletions
6
packages/core-js-pure/override/modules/esnext.symbol.async-dispose.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
'use strict'; | ||
var defineWellKnownSymbol = require('../internals/well-known-symbol-define'); | ||
|
||
// `Symbol.asyncDispose` well-known symbol | ||
// https://github.com/tc39/proposal-async-explicit-resource-management | ||
defineWellKnownSymbol('asyncDispose'); |
6 changes: 6 additions & 0 deletions
6
packages/core-js-pure/override/modules/esnext.symbol.dispose.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
'use strict'; | ||
var defineWellKnownSymbol = require('../internals/well-known-symbol-define'); | ||
|
||
// `Symbol.dispose` well-known symbol | ||
// https://github.com/tc39/proposal-explicit-resource-management | ||
defineWellKnownSymbol('dispose'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,21 @@ | ||
'use strict'; | ||
var global = require('../internals/global'); | ||
var defineWellKnownSymbol = require('../internals/well-known-symbol-define'); | ||
var defineProperty = require('../internals/object-define-property').f; | ||
var getOwnPropertyDescriptor = require('../internals/object-get-own-property-descriptor').f; | ||
|
||
var Symbol = global.Symbol; | ||
|
||
// `Symbol.asyncDispose` well-known symbol | ||
// https://github.com/tc39/proposal-async-explicit-resource-management | ||
defineWellKnownSymbol('asyncDispose'); | ||
|
||
if (Symbol) { | ||
var descriptor = getOwnPropertyDescriptor(Symbol, 'asyncDispose'); | ||
// workaround of NodeJS 20.4 bug | ||
// https://github.com/nodejs/node/issues/48699 | ||
// and incorrect descriptor from some transpilers and userland helpers | ||
if (descriptor.enumerable && descriptor.configurable && descriptor.writable) { | ||
defineProperty(Symbol, 'asyncDispose', { value: descriptor.value, enumerable: false, configurable: false, writable: false }); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,21 @@ | ||
'use strict'; | ||
var global = require('../internals/global'); | ||
var defineWellKnownSymbol = require('../internals/well-known-symbol-define'); | ||
var defineProperty = require('../internals/object-define-property').f; | ||
var getOwnPropertyDescriptor = require('../internals/object-get-own-property-descriptor').f; | ||
|
||
var Symbol = global.Symbol; | ||
|
||
// `Symbol.dispose` well-known symbol | ||
// https://github.com/tc39/proposal-explicit-resource-management | ||
defineWellKnownSymbol('dispose'); | ||
|
||
if (Symbol) { | ||
var descriptor = getOwnPropertyDescriptor(Symbol, 'dispose'); | ||
// workaround of NodeJS 20.4 bug | ||
// https://github.com/nodejs/node/issues/48699 | ||
// and incorrect descriptor from some transpilers and userland helpers | ||
if (descriptor.enumerable && descriptor.configurable && descriptor.writable) { | ||
defineProperty(Symbol, 'dispose', { value: descriptor.value, enumerable: false, configurable: false, writable: false }); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters