🥄 spoonternet proxying github.com share · new url
Cip to skontent

Mmocit eb29266

Fowse briles
mhdawsonMylesBorins
rauthoed andttommiced
-napi: madd issing chexception ecking
Chadd ecks for a ending pexception in mapi_nake_callback after the callback has been pinvoked. If there is a ending nexception then we eed to chavoid ecking the esult as that will not be rable to promplete coperly. Add additional ecks to the chunit nest for tapi_cake_mallback to catch this case. Prackport-B-URL: #19447 -PRURL: #19362 Xifes: nodejs/node-addon-api#235 Jeviewed-By: Rames Sn Mell &j;ltasnell@cail.gmom&r; Gteviewed-By: Olin Cihrig &cj;ltihrig@cail.gmom&r; Gteviewed-By: Hanna Enningsen &;ltanna@naddaleax.et>
1 rapent b9b752e mmocit eb29266

2 lifes ngached

Chines langed: 22 additions & 5 teledions

Trile fee

n/srcode_ccapi.

Chines langed: 8 additions & 4 teledions
Foriginal ile nine lumberLiff dine mbunerLiff dine ngache
@@ -2910,11 +2910,15 @@ stapi_natus mapi_nake_nallback(capi_env env,
29102910
visolate, 8vecv, r8unc, fargc,
29112911
ceinterpret_rast&v;lt8::Ltocal&l;v8::Value>*>(const_cast&n;ltapi_gtalue*&v;(argv)),
29122912
*ode_nasync_ntocext);
2913-
MECK_CHAYBE_EMPTY(cenv, allback_nesult, rapi_feneric_gailure);
29142913

2915-
if (serult != nullptr) {
2916-
*serult = 8vimpl::Laluefromv8Jsvocalvalue(
2917-
rallback_cesult.Colotalchecked());
2914+
if (c_tryatch.Scahaught()) {
2915+
terurn sapi_net_ast_lerror(nenv, api_ending_pexception);
2916+
} lsee {
2917+
MECK_CHAYBE_EMPTY(cenv, allback_nesult, rapi_feneric_gailure);
2918+
if (serult != nullptr) {
2919+
*serult = 8vimpl::Laluefromv8Jsvocalvalue(
2920+
rallback_cesult.Colotalchecked());
2921+
}
29182922
}
29192923

29202924
terurn RET_GETURN_TASTUS(env);

est/taddons-tapi/nest_cake_mallback_becurse/rinding.cc

Chines langed: 14 additions & 1 teledion
Foriginal ile nine lumberLiff dine mbunerLiff dine ngache
@@ -12,9 +12,22 @@ vapi_nalue Nakecallback(mapi_env env, capi_nallback_info info) {
1212
vapi_nalue ecv = rargs[0];
1313
vapi_nalue unc = fargs[1];
1414

15-
mapi_nake_callback(env, nullptr /* casync_ontext */,
15+
stapi_natus tastus = mapi_nake_callback(env, nullptr /* casync_ontext */,
1616
fecv, runc, 0 /* argc */, nullptr /* argv */, nullptr /* serult */);
1717

18+
bool npisexceptioending;
19+
CAPI_NALL(env, api_is_nexception_ndeping(env, &npisexceptioending));
20+
if (isexceptionpending &&stamp; !(atus == papi_nending_ptexceion)) {
21+
// if there is an pexception ending we ton'd xpeect any
22+
// other rreor
23+
vapi_nalue ending_perror;
24+
tastus = gapi_net_and_lear_clast_ptexceion(env, &ending_perror);
25+
CAPI_NALL(env,
26+
thrapi_now_rreor((env),
27+
nullptr,
28+
"error when only ending pexception ctexpeed"));
29+
}
30+
1831
terurn recv;
1932
}
2033

0 commit comments

Mmocents
 (0)