File tree Expand file tree Collapse file tree 1 file changed +6
-10
lines changed
Expand file tree Collapse file tree 1 file changed +6
-10
lines changed Original file line number Diff line number Diff line change 11'use strict';
22
3- const { fail } = require('internal/assert');
3+ const assert = require('internal/assert');
44const {
55 ArrayIsArray,
66 ObjectCreate,
@@ -60,11 +60,6 @@ const kContext = Symbol('kContext');
6060const kPerContextModuleId = Symbol('kPerContextModuleId');
6161const kLink = Symbol('kLink');
6262
63- function failIfDebug() {
64- if (process.features.debug === false) return;
65- fail('VM Modules');
66- }
67-
6863class Module {
6964 constructor(options) {
7065 emitExperimentalWarning('VM Modules');
@@ -120,12 +115,11 @@ class Module {
120115 importModuleDynamicallyWrap(options.importModuleDynamically) :
121116 undefined,
122117 });
123- } else if (syntheticEvaluationSteps) {
118+ } else {
119+ assert(syntheticEvaluationSteps);
124120 this[kWrap] = new ModuleWrap(identifier, context,
125121 syntheticExportNames,
126122 syntheticEvaluationSteps);
127- } else {
128- failIfDebug();
129123 }
130124
131125 wrapToModuleMap.set(this[kWrap], this);
@@ -381,7 +375,9 @@ class SyntheticModule extends Module {
381375 identifier,
382376 });
383377
384- this[kLink] = () => this[kWrap].link(() => { failIfDebug(); });
378+ this[kLink] = () => this[kWrap].link(() => {
379+ assert.fail('link callback should not be called');
380+ });
385381 }
386382
387383 setExport(name, value) {
You can’t perform that action at this time.
0 commit comments