mirror of
https://github.com/nodejs/node.git
synced 2024-11-21 10:59:27 +00:00
3ab0499d43
PR-URL: https://github.com/nodejs/node/pull/53124 Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
23 lines
480 B
JavaScript
23 lines
480 B
JavaScript
// Flags: --experimental-permission --allow-wasi --allow-fs-read=*
|
|
'use strict';
|
|
|
|
const common = require('../common');
|
|
common.skipIfWorker();
|
|
|
|
const assert = require('assert');
|
|
const { WASI } = require('wasi');
|
|
|
|
// Guarantee the initial state
|
|
{
|
|
assert.ok(process.permission.has('wasi'));
|
|
}
|
|
|
|
// When a permission is set by cli, the process shouldn't be able
|
|
// to create WASI instance unless --allow-wasi is sent
|
|
{
|
|
// doesNotThrow
|
|
new WASI({
|
|
version: 'preview1',
|
|
});
|
|
}
|