Skip to content

Commit

Permalink
fix(jsc): fix jsc crash on ios12
Browse files Browse the repository at this point in the history
  • Loading branch information
etkmao committed Jul 9, 2024
1 parent f1274a0 commit 3f3d5d9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions core/src/napi/jsc/jsc_ctx.cc
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ JSValueRef InvokeJsCallback(JSContextRef ctx,
void* external_data = func_wrapper->data;
CallbackInfo cb_info;
cb_info.SetSlot(func_data->global_external_data);
auto context = const_cast<JSGlobalContextRef>(ctx);
auto context = JSContextGetGlobalContext(ctx);
cb_info.SetReceiver(std::make_shared<JSCCtxValue>(context, object));
for (size_t i = 0; i < argumentCount; i++) {
cb_info.AddValue(std::make_shared<JSCCtxValue>(context, arguments[i]));
Expand Down Expand Up @@ -110,7 +110,7 @@ static JSValueRef JSObjectGetPropertyCallback(
JSValueRef *exception_ref) {

FuncData* func_data = reinterpret_cast<FuncData*>(JSObjectGetPrivate(object));
auto context = const_cast<JSGlobalContextRef>(ctx);
auto context = JSContextGetGlobalContext(ctx);
auto func_wrapper = reinterpret_cast<FuncWrapper*>(func_data->func_wrapper);
auto js_cb = func_wrapper->cb;
void* external_data = func_wrapper->data;
Expand Down

0 comments on commit 3f3d5d9

Please sign in to comment.