| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 3872a02 commit d31e6d9
3 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -402,11 +402,10 @@ function initializePolicy() { | |||
| 402 | 402 | } | |
| 403 | 403 | ||
| 404 | 404 | function initializeWASI() { | |
| 405 | - if (getOptionValue('--experimental-wasi-unstable-preview0')) { | ||
| 406 | - const { NativeModule } = require('internal/bootstrap/loaders'); | ||
| 407 | - const mod = NativeModule.map.get('wasi'); | ||
| 408 | - mod.canBeRequiredByUsers = true; | ||
| 409 | - } | ||
| 405 | + const { NativeModule } = require('internal/bootstrap/loaders'); | ||
| 406 | + const mod = NativeModule.map.get('wasi'); | ||
| 407 | + mod.canBeRequiredByUsers = | ||
| 408 | + getOptionValue('--experimental-wasi-unstable-preview0'); | ||
| 410 | 409 | } | |
| 411 | 410 | ||
| 412 | 411 | function initializeCJSLoader() { | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -98,6 +98,7 @@ void NativeModuleLoader::InitializeModuleCategories() { | |||
| 98 | 98 | #endif // !HAVE_OPENSSL | |
| 99 | 99 | ||
| 100 | 100 | "sys", // Deprecated. | |
| 101 | + "wasi", // Experimental. | ||
| 101 | 102 | "internal/test/binding", | |
| 102 | 103 | "internal/v8_prof_polyfill", | |
| 103 | 104 | "internal/v8_prof_processor", | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,9 @@ | |||
| 1 | + 'use strict'; | ||
| 2 | + // This test verifies that the WASI module cannot be require()'ed without a | ||
| 3 | + // CLI flag while it is still experimental. | ||
| 4 | + require('../common'); | ||
| 5 | + const assert = require('assert'); | ||
| 6 | + | ||
| 7 | + assert.throws(() => { | ||
| 8 | + require('wasi'); | ||
| 9 | + }, /^Error: Cannot find module 'wasi'/); | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments