mirror of
https://github.com/zebrajr/node.git
synced 2025-12-06 00:20:08 +01: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>
27 lines
665 B
JavaScript
27 lines
665 B
JavaScript
'use strict';
|
|
|
|
const common = require('../common');
|
|
common.skipIfWorker();
|
|
|
|
if (!common.hasCrypto) {
|
|
common.skip('no crypto');
|
|
}
|
|
|
|
const { spawnSync } = require('child_process');
|
|
const assert = require('assert');
|
|
const fixtures = require('../common/fixtures');
|
|
const file = fixtures.path('permission', 'processbinding.js');
|
|
|
|
// Due to linting rules-utils.js:isBinding check, process.binding() should
|
|
// not be called when --permission is enabled.
|
|
// Always spawn a child process
|
|
{
|
|
const { status, stderr } = spawnSync(
|
|
process.execPath,
|
|
[
|
|
'--permission', '--allow-fs-read=*', file,
|
|
],
|
|
);
|
|
assert.strictEqual(status, 0, stderr.toString());
|
|
}
|