diff options
author | Michaƫl Zasso <targos@protonmail.com> | 2017-12-24 16:26:24 +0100 |
---|---|---|
committer | Ruben Bridgewater <ruben@bridgewater.de> | 2018-02-01 13:46:56 +0100 |
commit | 9e1a6f8cb1e8b9cd596c42542a9ce6ded3734b1b (patch) | |
tree | feba8d2020c94912656a36cefd1f52fdd9d534ce /src/module_wrap.h | |
parent | 02b3bbc5e20e0d663c9e16d1617d78af10950905 (diff) | |
download | android-node-v8-9e1a6f8cb1e8b9cd596c42542a9ce6ded3734b1b.tar.gz android-node-v8-9e1a6f8cb1e8b9cd596c42542a9ce6ded3734b1b.tar.bz2 android-node-v8-9e1a6f8cb1e8b9cd596c42542a9ce6ded3734b1b.zip |
src,lib: implement import.meta
Implement the C++ callback that is required to configure the
`import.meta` object and add one property:
- url: absolute URL of the module
PR-URL: https://github.com/nodejs/node/pull/18368
Reviewed-By: Guy Bedford <guybedford@gmail.com>
Reviewed-By: Bradley Farias <bradley.meck@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com>
Diffstat (limited to 'src/module_wrap.h')
-rw-r--r-- | src/module_wrap.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/module_wrap.h b/src/module_wrap.h index bedf665165..5950c5a1be 100644 --- a/src/module_wrap.h +++ b/src/module_wrap.h @@ -23,6 +23,10 @@ class ModuleWrap : public BaseObject { static void Initialize(v8::Local<v8::Object> target, v8::Local<v8::Value> unused, v8::Local<v8::Context> context); + static void HostInitializeImportMetaObjectCallback( + v8::Local<v8::Context> context, + v8::Local<v8::Module> module, + v8::Local<v8::Object> meta); private: ModuleWrap(Environment* env, @@ -44,10 +48,14 @@ class ModuleWrap : public BaseObject { static void Resolve(const v8::FunctionCallbackInfo<v8::Value>& args); static void SetImportModuleDynamicallyCallback( const v8::FunctionCallbackInfo<v8::Value>& args); + static void SetInitializeImportMetaObjectCallback( + const v8::FunctionCallbackInfo<v8::Value>& args); static v8::MaybeLocal<v8::Module> ResolveCallback( v8::Local<v8::Context> context, v8::Local<v8::String> specifier, v8::Local<v8::Module> referrer); + static ModuleWrap* GetFromModule(node::Environment*, v8::Local<v8::Module>); + v8::Persistent<v8::Module> module_; v8::Persistent<v8::String> url_; |