summaryrefslogtreecommitdiff
path: root/lib/internal/errors.js
diff options
context:
space:
mode:
authorYael Hermon <yaelhe@wix.com>2019-01-04 20:02:25 +0200
committerDaniel Bevenius <daniel.bevenius@gmail.com>2019-01-18 05:39:58 +0100
commit01cd21973b26a2cbacbe143c5983cb4adf8e7681 (patch)
tree16d2712ba9e73dfdb9612acbcde6e0bd8423e097 /lib/internal/errors.js
parent74562356db6964f8057ef4bd897725793e55d513 (diff)
downloadandroid-node-v8-01cd21973b26a2cbacbe143c5983cb4adf8e7681.tar.gz
android-node-v8-01cd21973b26a2cbacbe143c5983cb4adf8e7681.tar.bz2
android-node-v8-01cd21973b26a2cbacbe143c5983cb4adf8e7681.zip
worker: enable passing command line flags
This PR adds the ability to provide Workers with their own execArgv flags in replacement of the main thread's execArgv. Only per-Isolate/per-Environment options are allowed. Per-Process options and V8 flags are not allowed. Passing an empty execArgv array will reset per-Isolate and per-Environment options of the Worker to their defaults. If execArgv option is not passed, the Worker will get the same flags as the main thread. Usage example: ``` const worker = new Worker(__filename, { execArgv: ['--trace-warnings'], }); ``` PR-URL: https://github.com/nodejs/node/pull/25467 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Diffstat (limited to 'lib/internal/errors.js')
-rw-r--r--lib/internal/errors.js3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/internal/errors.js b/lib/internal/errors.js
index 12b01ffb9b..b33cd27109 100644
--- a/lib/internal/errors.js
+++ b/lib/internal/errors.js
@@ -992,6 +992,9 @@ E('ERR_VM_MODULE_NOT_LINKED',
E('ERR_VM_MODULE_NOT_MODULE',
'Provided module is not an instance of Module', Error);
E('ERR_VM_MODULE_STATUS', 'Module status %s', Error);
+E('ERR_WORKER_INVALID_EXEC_ARGV', (errors) =>
+ `Initiated Worker with invalid execArgv flags: ${errors.join(', ')}`,
+ Error);
E('ERR_WORKER_PATH',
'The worker script filename must be an absolute path or a relative ' +
'path starting with \'./\' or \'../\'. Received "%s"',