mirror of
https://github.com/nodejs/node.git
synced 2025-12-28 07:50:41 +00:00
PR-URL: https://github.com/nodejs/node/pull/60845 Reviewed-By: Chemi Atlow <chemi@atlow.co.il> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
24 lines
579 B
JavaScript
24 lines
579 B
JavaScript
'use strict';
|
|
const common = require('../common');
|
|
common.skipIfInspectorDisabled();
|
|
|
|
// Test that read-only process.env access is considered to have no
|
|
// side-effects by the inspector.
|
|
|
|
const assert = require('assert');
|
|
const inspector = require('inspector');
|
|
|
|
const session = new inspector.Session();
|
|
session.connect();
|
|
|
|
process.env.TESTVAR = 'foobar';
|
|
|
|
session.post('Runtime.evaluate', {
|
|
expression: 'process.env.TESTVAR',
|
|
throwOnSideEffect: true
|
|
}, common.mustSucceed((res) => {
|
|
assert.deepStrictEqual(res, {
|
|
result: { type: 'string', value: 'foobar' }
|
|
});
|
|
}));
|