summaryrefslogtreecommitdiff
path: root/lib/vm.js
diff options
context:
space:
mode:
authorJoyee Cheung <joyeec9h3@gmail.com>2018-11-05 04:52:50 +0800
committerRich Trott <rtrott@gmail.com>2018-11-07 20:40:38 -0800
commitf895b5a58ec930d3ca49ebf34959a598c7669d77 (patch)
tree3ce1f6bcb6247fa6ecad1479c0d01e56d2f1074d /lib/vm.js
parent350bef6a103593f824e6a43ff52a86f1a48267db (diff)
downloadandroid-node-v8-f895b5a58ec930d3ca49ebf34959a598c7669d77.tar.gz
android-node-v8-f895b5a58ec930d3ca49ebf34959a598c7669d77.tar.bz2
android-node-v8-f895b5a58ec930d3ca49ebf34959a598c7669d77.zip
src: cache the result of GetOptions() in JS land
Instead of calling into C++ each time we need to check the value of a command line option, cache the option map in a new `internal/options` module for faster access to the values in JS land. PR-URL: https://github.com/nodejs/node/pull/24091 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Refael Ackermann <refack@gmail.com>
Diffstat (limited to 'lib/vm.js')
-rw-r--r--lib/vm.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/vm.js b/lib/vm.js
index 6e735bca4a..0cccd284bf 100644
--- a/lib/vm.js
+++ b/lib/vm.js
@@ -418,7 +418,7 @@ module.exports = {
compileFunction,
};
-if (internalBinding('options').getOptions('--experimental-vm-modules')) {
+if (require('internal/options').getOptionValue('--experimental-vm-modules')) {
const { SourceTextModule } = require('internal/vm/source_text_module');
module.exports.SourceTextModule = SourceTextModule;
}