2021-01-18 00:30:00 +01:00
|
|
|
// Flags: --expose-internals
|
|
|
|
'use strict';
|
|
|
|
|
|
|
|
const common = require('../common');
|
|
|
|
const assert = require('assert');
|
2024-05-03 00:57:03 +02:00
|
|
|
const { getOptionValue } = require('internal/options');
|
2021-01-18 00:30:00 +01:00
|
|
|
|
|
|
|
Map.prototype.get =
|
|
|
|
common.mustNotCall('`getOptionValue` must not call user-mutable method');
|
|
|
|
assert.strictEqual(getOptionValue('--expose-internals'), true);
|
2024-05-03 00:57:03 +02:00
|
|
|
|
|
|
|
Object.prototype['--nonexistent-option'] = 'foo';
|
|
|
|
assert.strictEqual(getOptionValue('--nonexistent-option'), undefined);
|
|
|
|
|
|
|
|
// Make the test common global leak test happy.
|
|
|
|
delete Object.prototype['--nonexistent-option'];
|