File tree Expand file tree Collapse file tree 1 file changed +19
-2
lines changed Expand file tree Collapse file tree 1 file changed +19
-2
lines changed Original file line number Diff line number Diff line change @@ -136,9 +136,26 @@ function prepareExecution(options) {
136136function setupSymbolDisposePolyfill ( ) {
137137 // TODO(MoLow): Remove this polyfill once Symbol.dispose and Symbol.asyncDispose are available in V8.
138138 // eslint-disable-next-line node-core/prefer-primordials
139- Symbol . dispose ??= SymbolDispose ;
139+ if ( typeof Symbol . dispose !== 'symbol' ) {
140+ ObjectDefineProperty ( Symbol , 'dispose' , {
141+ __proto__ : null ,
142+ configurable : false ,
143+ enumerable : false ,
144+ value : SymbolDispose ,
145+ writable : false ,
146+ } ) ;
147+ }
148+
140149 // eslint-disable-next-line node-core/prefer-primordials
141- Symbol . asyncDispose ??= SymbolAsyncDispose ;
150+ if ( typeof Symbol . asyncDispose !== 'symbol' ) {
151+ ObjectDefineProperty ( Symbol , 'asyncDispose' , {
152+ __proto__ : null ,
153+ configurable : false ,
154+ enumerable : false ,
155+ value : SymbolAsyncDispose ,
156+ writable : false ,
157+ } ) ;
158+ }
142159}
143160
144161function setupUserModules ( isLoaderWorker = false ) {
You can’t perform that action at this time.
0 commit comments