Files
node/test/parallel/test-internal-modules-expose.js
T
Sam Roberts 8086cb68ae src: use option parser for expose_internals
bootstrap_node.js was directly parsing process.execArgv to see if
internals should be exposed, even though the argv was already parsed by
node. This is unusual and unnecessary, change it to set the option value
from the parser onto the config binding.

PR-URL: https://github.com/nodejs/node/pull/12245
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2017-04-13 07:09:39 -07:00

12 lines
307 B
JavaScript

'use strict';
// Flags: --expose_internals
require('../common');
const assert = require('assert');
const config = process.binding('config');
console.log(config, process.argv);
assert.strictEqual(typeof require('internal/freelist').FreeList, 'function');
assert.strictEqual(config.exposeInternals, true);