mirror of
https://github.com/nodejs/node.git
synced 2024-11-21 10:59:27 +00:00
20 lines
378 B
JavaScript
20 lines
378 B
JavaScript
|
// Flags: --experimental-permission --allow-fs-read=*
|
||
|
'use strict';
|
||
|
|
||
|
const common = require('../common');
|
||
|
const assert = require('node:assert');
|
||
|
|
||
|
const { WASI } = require('wasi');
|
||
|
|
||
|
{
|
||
|
assert.throws(() => {
|
||
|
new WASI({
|
||
|
version: 'preview1',
|
||
|
preopens: { '/': '/' },
|
||
|
});
|
||
|
}, common.expectsError({
|
||
|
code: 'ERR_ACCESS_DENIED',
|
||
|
permission: 'WASI',
|
||
|
}));
|
||
|
}
|