File tree 1 file changed +6
-9
lines changed 1 file changed +6
-9
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
4
const {
4
5
ArrayIsArray,
5
6
ObjectCreate,
@@ -58,13 +59,9 @@ const kContext = Symbol('kContext');
58
59
const kPerContextModuleId = Symbol ( 'kPerContextModuleId' ) ;
59
60
const kLink = Symbol ( 'kLink' ) ;
60
61
61
- // Helper caried over from js2c_macros: exits process and prints debug message
62
- // iff node_debug_lib flag is set.
63
- function CHECK ( x ) {
64
- if ( process . config . variables . node_debug_lib === false ) return ;
65
- if ( ! x ) {
66
- ( process . _rawDebug ( 'CHECK: x == true' ) , process . abort ( ) ) ;
67
- }
62
+ function failIfDebug ( ) {
63
+ if ( process . features . debug === false ) return ;
64
+ fail ( 'VM Modules' ) ;
68
65
}
69
66
70
67
class Module {
@@ -127,7 +124,7 @@ class Module {
127
124
syntheticExportNames ,
128
125
syntheticEvaluationSteps ) ;
129
126
} else {
130
- CHECK ( false ) ;
127
+ failIfDebug ( ) ;
131
128
}
132
129
133
130
wrapToModuleMap . set ( this [ kWrap ] , this ) ;
@@ -383,7 +380,7 @@ class SyntheticModule extends Module {
383
380
identifier,
384
381
} ) ;
385
382
386
- this [ kLink ] = ( ) => this [ kWrap ] . link ( ( ) => { CHECK ( false ) ; } ) ;
383
+ this [ kLink ] = ( ) => this [ kWrap ] . link ( ( ) => { failIfDebug ( ) ; } ) ;
387
384
}
388
385
389
386
setExport ( name , value ) {
You can’t perform that action at this time.
0 commit comments