Skip to content

Commit

Permalink
add import.meta
Browse files Browse the repository at this point in the history
  • Loading branch information
mmomtchev committed Jul 16, 2022
1 parent 7f24660 commit 285a377
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/js_native_api_v8.cc
Original file line number Diff line number Diff line change
Expand Up @@ -887,7 +887,9 @@ napi_status NAPI_CDECL napi_create_environment(napi_platform platform,
"const internalLoader = new ESMLoader;"
"const parent_path = require('url').pathToFileURL(process.argv[0]);"
"global.import = (mod) => internalLoader.import(mod, parent_path, "
"Object.create(null));";
"Object.create(null));"
"global.import.meta = { url: parent_path };"
;

auto wrapper = reinterpret_cast<v8impl::PlatformWrapper*>(platform);
std::vector<std::string> errors_vec;
Expand Down

0 comments on commit 285a377

Please sign in to comment.