summaryrefslogtreecommitdiff
path: root/src/module_wrap.h
diff options
context:
space:
mode:
authorGuy Bedford <guybedford@gmail.com>2018-02-12 13:02:42 +0200
committerguybedford <guybedford@gmail.com>2018-02-14 16:35:12 +0200
commitf1fc426cce9db230cb83866871f355afa0b92d3b (patch)
treec0c4bd08e279d6696d3b2542f8ab62d713d2a61d /src/module_wrap.h
parent0e7b61229aa602e55c5fb034a63d7da97eecff3b (diff)
downloadandroid-node-v8-f1fc426cce9db230cb83866871f355afa0b92d3b.tar.gz
android-node-v8-f1fc426cce9db230cb83866871f355afa0b92d3b.tar.bz2
android-node-v8-f1fc426cce9db230cb83866871f355afa0b92d3b.zip
module: support main w/o extension, pjson cache
This adds support for ensuring that the top-level main into Node is supported loading when it has no extension for backwards-compat with NodeJS bin workflows. In addition package.json caching is implemented in the module lookup process. PR-URL: https://github.com/nodejs/node/pull/18728 Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Diffstat (limited to 'src/module_wrap.h')
-rw-r--r--src/module_wrap.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/module_wrap.h b/src/module_wrap.h
index 5950c5a1be..ee3740b561 100644
--- a/src/module_wrap.h
+++ b/src/module_wrap.h
@@ -12,10 +12,15 @@
namespace node {
namespace loader {
+enum PackageMainCheck : bool {
+ CheckMain = true,
+ IgnoreMain = false
+};
+
v8::Maybe<url::URL> Resolve(Environment* env,
const std::string& specifier,
const url::URL& base,
- bool read_pkg_json = false);
+ PackageMainCheck read_pkg_json = CheckMain);
class ModuleWrap : public BaseObject {
public: