mirror of
https://github.com/nodejs/node.git
synced 2025-04-28 21:46:48 +00:00

Move permission model from 1.1 (Active Development) to 2.0 (Stable). PR-URL: https://github.com/nodejs/node/pull/56201 Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com> Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Stephen Belanger <admin@stephenbelanger.com>
31 lines
639 B
JavaScript
31 lines
639 B
JavaScript
// Flags: --permission --allow-fs-read=*
|
|
'use strict';
|
|
|
|
const common = require('../common');
|
|
common.skipIfWorker();
|
|
if (!common.hasCrypto)
|
|
common.skip('no crypto');
|
|
|
|
const assert = require('assert');
|
|
const v8 = require('v8');
|
|
const path = require('path');
|
|
|
|
{
|
|
assert.throws(() => {
|
|
v8.writeHeapSnapshot('./secret.txt');
|
|
}, common.expectsError({
|
|
code: 'ERR_ACCESS_DENIED',
|
|
permission: 'FileSystemWrite',
|
|
resource: path.toNamespacedPath('./secret.txt'),
|
|
}));
|
|
}
|
|
|
|
{
|
|
assert.throws(() => {
|
|
v8.writeHeapSnapshot();
|
|
}, common.expectsError({
|
|
code: 'ERR_ACCESS_DENIED',
|
|
permission: 'FileSystemWrite',
|
|
}));
|
|
}
|