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 — repl: do not define `wasi` on global with no flag · nodejs/node@b999983

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • lib/internal/main
    • repl.js
  • test/parallel
    • test-repl-built-in-modules.js
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎lib/internal/main/repl.js‎

Copy file name to clipboardExpand all lines: lib/internal/main/repl.js
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ const {
88
markBootstrapComplete
99
} = require('internal/process/pre_execution');
1010

11-
const esmLoader = require('internal/process/esm_loader');
1211
const {
1312
evalScript
1413
} = require('internal/process/execution');
@@ -34,6 +33,7 @@ if (process.env.NODE_REPL_EXTERNAL_MODULE) {
3433
process.exit(1);
3534
}
3635

36+
const esmLoader = require('internal/process/esm_loader');
3737
esmLoader.loadESM(() => {
3838
console.log(`Welcome to Node.js ${process.version}.\n` +
3939
'Type ".help" for more information.');
Collapse file

‎test/parallel/test-repl-built-in-modules.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-repl-built-in-modules.js
+16Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,19 @@ assert.doesNotMatch(
3030
stdout,
3131
/Uncaught Error: Cannot find module 'wasi'[\w\W]+- <repl>\n/);
3232
assert.match(stdout, /{ WASI: \[class WASI\] }/);
33+
34+
{
35+
const res = cp.execFileSync(process.execPath, ['-i'], {
36+
input: "'wasi' in global",
37+
encoding: 'utf8',
38+
});
39+
// `wasi` shouldn't be defined on global when the flag is not set
40+
assert.match(res, /false\n/);
41+
}
42+
{
43+
const res = cp.execFileSync(process.execPath, ['-i', '--experimental-wasi-unstable-preview1'], {
44+
input: "'wasi' in global",
45+
encoding: 'utf8',
46+
});
47+
assert.match(res, /true\n/);
48+
}

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.