node/test/parallel/test-options-binding.js
ExE Boss 3ec71143f2
lib: support returning Safe collections from C++
Co-authored-by: Antoine du Hamel <duhamelantoine1995@gmail.com>

PR-URL: https://github.com/nodejs/node/pull/36989
Refs: https://github.com/nodejs/node/pull/36652
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2021-01-22 19:49:04 -08:00

19 lines
614 B
JavaScript

// Flags: --expose-internals
'use strict';
const common = require('../common');
const { primordials: { SafeMap } } = require('internal/test/binding');
const { options, aliases, getOptionValue } = require('internal/options');
const assert = require('assert');
assert(options instanceof SafeMap,
"require('internal/options').options is a SafeMap");
assert(aliases instanceof SafeMap,
"require('internal/options').aliases is a SafeMap");
Map.prototype.get =
common.mustNotCall('`getOptionValue` must not call user-mutable method');
assert.strictEqual(getOptionValue('--expose-internals'), true);