diff options
author | itaysabato <itaysabato@gmail.com> | 2018-06-26 18:31:36 +0300 |
---|---|---|
committer | Benjamin Gruenbaum <benji@peer5.com> | 2018-06-27 10:38:01 +0300 |
commit | 8d33bbf16807e9219809f9528e8884a1c0a98277 (patch) | |
tree | ba0cb761c6b15489616275131667380e1b30120e /doc | |
parent | 8326bea6c2833b653f92239725bf4a32e5f52c90 (diff) | |
download | android-node-v8-8d33bbf16807e9219809f9528e8884a1c0a98277.tar.gz android-node-v8-8d33bbf16807e9219809f9528e8884a1c0a98277.tar.bz2 android-node-v8-8d33bbf16807e9219809f9528e8884a1c0a98277.zip |
worker: support relative paths
This commit adds support for relative paths in Worker.
Paths are relative to the current working directory.
PR-URL: https://github.com/nodejs/node/pull/21407
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Guy Bedford <guybedford@gmail.com>
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
Diffstat (limited to 'doc')
-rw-r--r-- | doc/api/errors.md | 7 | ||||
-rw-r--r-- | doc/api/worker_threads.md | 4 |
2 files changed, 7 insertions, 4 deletions
diff --git a/doc/api/errors.md b/doc/api/errors.md index 0fbd383676..00e44618ef 100644 --- a/doc/api/errors.md +++ b/doc/api/errors.md @@ -1754,10 +1754,11 @@ The fulfilled value of a linking promise is not a `vm.Module` object. The current module's status does not allow for this operation. The specific meaning of the error depends on the specific function. -<a id="ERR_WORKER_NEED_ABSOLUTE_PATH"></a> -### ERR_WORKER_NEED_ABSOLUTE_PATH +<a id="ERR_WORKER_PATH"></a> +### ERR_WORKER_PATH -The path for the main script of a worker is not an absolute path. +The path for the main script of a worker is neither an absolute path +nor a relative path starting with `./` or `../`. <a id="ERR_WORKER_UNSERIALIZABLE_ERROR"></a> ### ERR_WORKER_UNSERIALIZABLE_ERROR diff --git a/doc/api/worker_threads.md b/doc/api/worker_threads.md index b56fb32aec..9578403c5c 100644 --- a/doc/api/worker_threads.md +++ b/doc/api/worker_threads.md @@ -306,7 +306,9 @@ if (isMainThread) { ### new Worker(filename[, options]) -* `filename` {string} The absolute path to the Worker’s main script. +* `filename` {string} The path to the Worker’s main script. Must be + either an absolute path or a relative path (i.e. relative to the + current working directory) starting with `./` or `../`. If `options.eval` is true, this is a string containing JavaScript code rather than a path. * `options` {Object} |