Skip to content

Commit

Permalink
[unity]最新版qjs的兼容,该backend分支:https://github.com/puerts/backend-quickjs…
Browse files Browse the repository at this point in the history
  • Loading branch information
chexiongsheng committed Apr 18, 2024
1 parent 801b68a commit d6d40e5
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions unity/native_src/Src/BackendEnv.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -713,6 +713,18 @@ JSValue esmodule::ExecuteModule(JSContext *ctx, JSValueConst this_val, int argc,
if (JS_IsException(EvalRet)) {
return EvalRet;
}
#if defined(JS_EVAL_FLAG_ASYNC)
if (!JS_IsUndefined(EvalRet))
{
JSPromiseStateEnum state = JS_PromiseState(ctx, EvalRet);
if (state == JS_PROMISE_REJECTED)
{
auto ret = JS_Throw(ctx, JS_PromiseResult(ctx, EvalRet));
JS_FreeValue(ctx, EvalRet);
return ret;
}
}
#endif
JS_FreeValue(ctx, EvalRet);
auto Namespace = JS_GET_MODULE_NS(ctx, EntryModule);
if (JS_IsUndefined(Namespace) || JS_IsNull(Namespace))
Expand Down

0 comments on commit d6d40e5

Please sign in to comment.