GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — lib: further simplify assertions in vm/module · nodejs/node@5dd9fb2

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • lib/internal/vm
    • module.js
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎lib/internal/vm/module.js‎

Copy file name to clipboardExpand all lines: lib/internal/vm/module.js
+6-10Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
'use strict';
22

3-
const { fail } = require('internal/assert');
3+
const assert = require('internal/assert');
44
const {
55
ArrayIsArray,
66
ObjectCreate,
@@ -60,11 +60,6 @@ const kContext = Symbol('kContext');
6060
const kPerContextModuleId = Symbol('kPerContextModuleId');
6161
const kLink = Symbol('kLink');
6262

63-
function failIfDebug() {
64-
if (process.features.debug === false) return;
65-
fail('VM Modules');
66-
}
67-
6863
class 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) {

0 commit comments

Comments
0 (0)
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.