File tree 1 file changed +6
-10
lines changed
1 file changed +6
-10
lines changed Original file line number Diff line number Diff line change 1
1
'use strict' ;
2
2
3
- const { fail } = require ( 'internal/assert' ) ;
3
+ const assert = require ( 'internal/assert' ) ;
4
4
const {
5
5
ArrayIsArray,
6
6
ObjectCreate,
@@ -59,11 +59,6 @@ const kContext = Symbol('kContext');
59
59
const kPerContextModuleId = Symbol ( 'kPerContextModuleId' ) ;
60
60
const kLink = Symbol ( 'kLink' ) ;
61
61
62
- function failIfDebug ( ) {
63
- if ( process . features . debug === false ) return ;
64
- fail ( 'VM Modules' ) ;
65
- }
66
-
67
62
class Module {
68
63
constructor ( options ) {
69
64
emitExperimentalWarning ( 'VM Modules' ) ;
@@ -119,12 +114,11 @@ class Module {
119
114
importModuleDynamicallyWrap ( options . importModuleDynamically ) :
120
115
undefined ,
121
116
} ) ;
122
- } else if ( syntheticEvaluationSteps ) {
117
+ } else {
118
+ assert ( syntheticEvaluationSteps ) ;
123
119
this [ kWrap ] = new ModuleWrap ( identifier , context ,
124
120
syntheticExportNames ,
125
121
syntheticEvaluationSteps ) ;
126
- } else {
127
- failIfDebug ( ) ;
128
122
}
129
123
130
124
wrapToModuleMap . set ( this [ kWrap ] , this ) ;
@@ -380,7 +374,9 @@ class SyntheticModule extends Module {
380
374
identifier,
381
375
} ) ;
382
376
383
- this [ kLink ] = ( ) => this [ kWrap ] . link ( ( ) => { failIfDebug ( ) ; } ) ;
377
+ this [ kLink ] = ( ) => this [ kWrap ] . link ( ( ) => {
378
+ assert . fail ( 'link callback should not be called' ) ;
379
+ } ) ;
384
380
}
385
381
386
382
setExport ( name , value ) {
You can’t perform that action at this time.
0 commit comments