mirror of
https://github.com/nodejs/node.git
synced 2024-11-21 10:59:27 +00:00
bf31d3c3b1
Fixes: https://github.com/nodejs/node/issues/36246 PR-URL: https://github.com/nodejs/node/pull/36248 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
31 lines
645 B
JavaScript
31 lines
645 B
JavaScript
'use strict';
|
|
const common = require('../common');
|
|
common.skipIfInspectorDisabled();
|
|
|
|
// Regression test for https://github.com/nodejs/node/issues/27518.
|
|
|
|
const assert = require('assert');
|
|
const inspector = require('inspector');
|
|
const vm = require('vm');
|
|
|
|
const session = new inspector.Session();
|
|
session.connect();
|
|
|
|
const context = vm.createContext({
|
|
a: 100
|
|
});
|
|
|
|
session.post('Runtime.evaluate', {
|
|
expression: 'a',
|
|
throwOnSideEffect: true,
|
|
contextId: 2 // context's id
|
|
}, common.mustSucceed((res) => {
|
|
assert.deepStrictEqual(res, {
|
|
result: {
|
|
type: 'number',
|
|
value: context.a,
|
|
description: '100'
|
|
}
|
|
});
|
|
}));
|