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 @@ -120,9 +120,26 @@ function prepareExecution(options) {
120120function setupSymbolDisposePolyfill ( ) {
121121 // TODO(MoLow): Remove this polyfill once Symbol.dispose and Symbol.asyncDispose are available in V8.
122122 // eslint-disable-next-line node-core/prefer-primordials
123- Symbol . dispose ??= SymbolDispose ;
123+ if ( typeof Symbol . dispose !== 'symbol' ) {
124+ ObjectDefineProperty ( Symbol , 'dispose' , {
125+ __proto__ : null ,
126+ configurable : false ,
127+ enumerable : false ,
128+ value : SymbolDispose ,
129+ writable : false ,
130+ } ) ;
131+ }
132+
124133 // eslint-disable-next-line node-core/prefer-primordials
125- Symbol . asyncDispose ??= SymbolAsyncDispose ;
134+ if ( typeof Symbol . asyncDispose !== 'symbol' ) {
135+ ObjectDefineProperty ( Symbol , 'asyncDispose' , {
136+ __proto__ : null ,
137+ configurable : false ,
138+ enumerable : false ,
139+ value : SymbolAsyncDispose ,
140+ writable : false ,
141+ } ) ;
142+ }
126143}
127144
128145function setupUserModules ( isLoaderWorker = false ) {
You can’t perform that action at this time.
0 commit comments