Skip to content

Commit

Permalink
修改import.meta.url
Browse files Browse the repository at this point in the history
  • Loading branch information
scgm0 committed Apr 23, 2024
1 parent 0fba9a9 commit 33e4bdd
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions unity/native_src/Src/BackendEnv.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -578,7 +578,6 @@ JSModuleDef* FBackendEnv::LoadModule(JSContext* ctx, const char *name)

auto Meta = JS_GetImportMeta(ctx, Ret);
std::string str = name;
str = "puer:" + str;
JS_SetPropertyStr(ctx, Meta, "url", JS_NewString(ctx, str.c_str()));
JS_FreeValue(ctx, Meta);

Expand Down Expand Up @@ -961,7 +960,7 @@ void esmodule::HostInitializeImportMetaObject(v8::Local<v8::Context> Context, v8
meta->CreateDataProperty(
Context,
v8::String::NewFromUtf8(Isolate, "url").ToLocalChecked(),
v8::String::NewFromUtf8(Isolate, ("puer:" + iter->second).c_str()).ToLocalChecked()
v8::String::NewFromUtf8(Isolate, iter->second.c_str()).ToLocalChecked()
).ToChecked();
}
}
Expand Down

0 comments on commit 33e4bdd

Please sign in to comment.