mirror of
https://github.com/openharmony/ace_ace_engine.git
synced 2026-07-19 22:54:50 -04:00
!7 fix promise callback unhandled
Merge pull request !7 from chenqy930/fix-promise
This commit is contained in:
@@ -2222,8 +2222,9 @@ JSValue QjsEngineInstance::FireJsEvent(const std::string& param)
|
||||
QjsUtils::ParseJSON(ctx, param.c_str(), param.size(), nullptr),
|
||||
};
|
||||
|
||||
JSValue retVal = JS_Call(ctx, callJsFunc, JS_UNDEFINED, countof(argv), argv);
|
||||
JSValue retVal = JS_Call(ctx, callJsFunc, globalObj, countof(argv), argv);
|
||||
|
||||
js_std_loop(ctx);
|
||||
JS_FreeValue(ctx, globalObj);
|
||||
|
||||
// It is up to the caller to check this value. No exception checks here.
|
||||
@@ -2259,8 +2260,9 @@ void QjsEngineInstance::CallJs(const std::string& callbackId, const std::string&
|
||||
QjsUtils::NewString(ctx, std::to_string(instanceId).c_str()),
|
||||
QjsUtils::ParseJSON(ctx, callBuff.c_str(), callBuff.size(), nullptr),
|
||||
};
|
||||
QjsUtils::Call(ctx, callJsFunc, JS_UNDEFINED, countof(argv), argv);
|
||||
QjsUtils::Call(ctx, callJsFunc, globalObj, countof(argv), argv);
|
||||
|
||||
js_std_loop(ctx);
|
||||
JS_FreeValue(ctx, globalObj);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user