2024-12-12 09:11:58 -03:00
|
|
|
// Flags: --permission --allow-fs-read=*
|
2024-06-01 10:13:12 -03:00
|
|
|
'use strict';
|
|
|
|
|
|
|
|
const common = require('../common');
|
|
|
|
const assert = require('node:assert');
|
|
|
|
|
|
|
|
const { WASI } = require('wasi');
|
|
|
|
|
|
|
|
{
|
|
|
|
assert.throws(() => {
|
|
|
|
new WASI({
|
|
|
|
version: 'preview1',
|
|
|
|
preopens: { '/': '/' },
|
|
|
|
});
|
|
|
|
}, common.expectsError({
|
2025-04-03 19:24:39 -03:00
|
|
|
message: 'Access to this API has been restricted. Use --allow-wasi to manage permissions.',
|
2024-06-01 10:13:12 -03:00
|
|
|
code: 'ERR_ACCESS_DENIED',
|
|
|
|
permission: 'WASI',
|
|
|
|
}));
|
|
|
|
}
|