File tree Expand file tree Collapse file tree 1 file changed +6
-9
lines changed Expand file tree Collapse file tree 1 file changed +6
-9
lines changed Original file line number Diff line number Diff line change 11'use strict' ;
22
3+ const { fail } = require ( 'internal/assert' ) ;
34const {
45 ArrayIsArray,
56 ObjectCreate,
@@ -58,13 +59,9 @@ const kContext = Symbol('kContext');
5859const kPerContextModuleId = Symbol ( 'kPerContextModuleId' ) ;
5960const kLink = Symbol ( 'kLink' ) ;
6061
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' ) ;
6865}
6966
7067class Module {
@@ -127,7 +124,7 @@ class Module {
127124 syntheticExportNames ,
128125 syntheticEvaluationSteps ) ;
129126 } else {
130- CHECK ( false ) ;
127+ failIfDebug ( ) ;
131128 }
132129
133130 wrapToModuleMap . set ( this [ kWrap ] , this ) ;
@@ -383,7 +380,7 @@ class SyntheticModule extends Module {
383380 identifier,
384381 } ) ;
385382
386- this [ kLink ] = ( ) => this [ kWrap ] . link ( ( ) => { CHECK ( false ) ; } ) ;
383+ this [ kLink ] = ( ) => this [ kWrap ] . link ( ( ) => { failIfDebug ( ) ; } ) ;
387384 }
388385
389386 setExport ( name , value ) {
You can’t perform that action at this time.
0 commit comments