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 @@ -128,9 +128,26 @@ function prepareExecution(options) {
128128function setupSymbolDisposePolyfill ( ) {
129129 // TODO(MoLow): Remove this polyfill once Symbol.dispose and Symbol.asyncDispose are available in V8.
130130 // eslint-disable-next-line node-core/prefer-primordials
131- Symbol . dispose ??= SymbolDispose ;
131+ if ( typeof Symbol . dispose !== 'symbol' ) {
132+ ObjectDefineProperty ( Symbol , 'dispose' , {
133+ __proto__ : null ,
134+ configurable : false ,
135+ enumerable : false ,
136+ value : SymbolDispose ,
137+ writable : false ,
138+ } ) ;
139+ }
140+
132141 // eslint-disable-next-line node-core/prefer-primordials
133- Symbol . asyncDispose ??= SymbolAsyncDispose ;
142+ if ( typeof Symbol . asyncDispose !== 'symbol' ) {
143+ ObjectDefineProperty ( Symbol , 'asyncDispose' , {
144+ __proto__ : null ,
145+ configurable : false ,
146+ enumerable : false ,
147+ value : SymbolAsyncDispose ,
148+ writable : false ,
149+ } ) ;
150+ }
134151}
135152
136153function setupUserModules ( isLoaderWorker = false ) {
You can’t perform that action at this time.
0 commit comments