From 3454f65ebec2864ffc6173876a313c1ff6aff08f Mon Sep 17 00:00:00 2001 From: cjihrig Date: Sun, 15 Dec 2019 11:30:45 -0500 Subject: [PATCH] doc,lib,src,test: rename WASI CLI flag The WASI API has moved from preview0 to preview1. This commit updates the CLI flag accordingly. PR-URL: https://github.com/nodejs/node/pull/30980 Reviewed-By: David Carlier Reviewed-By: Anna Henningsen Reviewed-By: Rich Trott --- doc/api/cli.md | 4 ++-- doc/api/wasi.md | 2 +- doc/node.1 | 2 +- lib/internal/bootstrap/pre_execution.js | 2 +- src/node_options.cc | 2 +- test/wasi/test-wasi-binding.js | 2 +- test/wasi/test-wasi-options-validation.js | 2 +- test/wasi/test-wasi-start-validation.js | 2 +- test/wasi/test-wasi-symlinks.js | 2 +- test/wasi/test-wasi.js | 2 +- 10 files changed, 11 insertions(+), 11 deletions(-) diff --git a/doc/api/cli.md b/doc/api/cli.md index 1fa9036938af8f..27beb408c0ff19 100644 --- a/doc/api/cli.md +++ b/doc/api/cli.md @@ -221,7 +221,7 @@ added: v9.6.0 Enable experimental ES Module support in the `vm` module. -### `--experimental-wasi-unstable-preview0` +### `--experimental-wasi-unstable-preview1` @@ -1107,7 +1107,7 @@ Node.js options that are allowed are: * `--experimental-report` * `--experimental-specifier-resolution` * `--experimental-vm-modules` -* `--experimental-wasi-unstable-preview0` +* `--experimental-wasi-unstable-preview1` * `--experimental-wasm-modules` * `--force-context-aware` * `--force-fips` diff --git a/doc/api/wasi.md b/doc/api/wasi.md index bd71f332804cb6..ab994e498305d1 100644 --- a/doc/api/wasi.md +++ b/doc/api/wasi.md @@ -29,7 +29,7 @@ const importObject = { wasi_snapshot_preview1: wasi.wasiImport }; })(); ``` -The `--experimental-wasi-unstable-preview0` and `--experimental-wasm-bigint` +The `--experimental-wasi-unstable-preview1` and `--experimental-wasm-bigint` CLI arguments are needed for the previous example to run. ## Class: WASI diff --git a/doc/node.1 b/doc/node.1 index 8d99435b852804..822a6b72894f61 100644 --- a/doc/node.1 +++ b/doc/node.1 @@ -141,7 +141,7 @@ feature. .It Fl -experimental-vm-modules Enable experimental ES module support in VM module. . -.It Fl -experimental-wasi-unstable-preview0 +.It Fl -experimental-wasi-unstable-preview1 Enable experimental WebAssembly System Interface support. . .It Fl -experimental-wasm-modules diff --git a/lib/internal/bootstrap/pre_execution.js b/lib/internal/bootstrap/pre_execution.js index 67fcfc8fbf172f..004684d522102b 100644 --- a/lib/internal/bootstrap/pre_execution.js +++ b/lib/internal/bootstrap/pre_execution.js @@ -405,7 +405,7 @@ function initializeWASI() { const { NativeModule } = require('internal/bootstrap/loaders'); const mod = NativeModule.map.get('wasi'); mod.canBeRequiredByUsers = - getOptionValue('--experimental-wasi-unstable-preview0'); + getOptionValue('--experimental-wasi-unstable-preview1'); } function initializeCJSLoader() { diff --git a/src/node_options.cc b/src/node_options.cc index 2d0c4df067de17..1e6b5454d57e8f 100644 --- a/src/node_options.cc +++ b/src/node_options.cc @@ -397,7 +397,7 @@ EnvironmentOptionsParser::EnvironmentOptionsParser() { &EnvironmentOptions::experimental_report, kAllowedInEnvironment); #endif // NODE_REPORT - AddOption("--experimental-wasi-unstable-preview0", + AddOption("--experimental-wasi-unstable-preview1", "experimental WASI support", &EnvironmentOptions::experimental_wasi, kAllowedInEnvironment); diff --git a/test/wasi/test-wasi-binding.js b/test/wasi/test-wasi-binding.js index 876c8a15a72c13..b3e5f02085b663 100644 --- a/test/wasi/test-wasi-binding.js +++ b/test/wasi/test-wasi-binding.js @@ -1,4 +1,4 @@ -// Flags: --experimental-wasi-unstable-preview0 +// Flags: --experimental-wasi-unstable-preview1 'use strict'; const common = require('../common'); diff --git a/test/wasi/test-wasi-options-validation.js b/test/wasi/test-wasi-options-validation.js index f8ec2604d5b9f1..fe23e446b08733 100644 --- a/test/wasi/test-wasi-options-validation.js +++ b/test/wasi/test-wasi-options-validation.js @@ -1,6 +1,6 @@ 'use strict'; -// Flags: --experimental-wasi-unstable-preview0 +// Flags: --experimental-wasi-unstable-preview1 require('../common'); const assert = require('assert'); diff --git a/test/wasi/test-wasi-start-validation.js b/test/wasi/test-wasi-start-validation.js index 8c8c6f7e44acc6..a31c5847968491 100644 --- a/test/wasi/test-wasi-start-validation.js +++ b/test/wasi/test-wasi-start-validation.js @@ -1,4 +1,4 @@ -// Flags: --experimental-wasi-unstable-preview0 +// Flags: --experimental-wasi-unstable-preview1 'use strict'; const common = require('../common'); diff --git a/test/wasi/test-wasi-symlinks.js b/test/wasi/test-wasi-symlinks.js index 56e49331b0bc76..8332c8d147d9c4 100644 --- a/test/wasi/test-wasi-symlinks.js +++ b/test/wasi/test-wasi-symlinks.js @@ -59,7 +59,7 @@ if (process.argv[2] === 'wasi-child') { console.log('executing', options.test); const opts = { env: { ...process.env, NODE_DEBUG_NATIVE: 'wasi' } }; const child = cp.spawnSync(process.execPath, [ - '--experimental-wasi-unstable-preview0', + '--experimental-wasi-unstable-preview1', '--experimental-wasm-bigint', __filename, 'wasi-child', diff --git a/test/wasi/test-wasi.js b/test/wasi/test-wasi.js index f80ed835f82ed5..9c8b2a752778f9 100644 --- a/test/wasi/test-wasi.js +++ b/test/wasi/test-wasi.js @@ -44,7 +44,7 @@ if (process.argv[2] === 'wasi-child') { opts.input = options.stdin; const child = cp.spawnSync(process.execPath, [ - '--experimental-wasi-unstable-preview0', + '--experimental-wasi-unstable-preview1', '--experimental-wasm-bigint', __filename, 'wasi-child',