@@ -1320,6 +1320,7 @@ static JSValue js_module_ns_autoinit(JSContext *ctx, JSObject *p, JSAtom atom,
1320
1320
void *opaque);
1321
1321
static JSValue JS_InstantiateFunctionListItem2(JSContext *ctx, JSObject *p,
1322
1322
JSAtom atom, void *opaque);
1323
+ static void js_set_uncatchable_error(JSContext *ctx, JSValue val, BOOL flag);
1323
1324
1324
1325
static JSValue js_new_callsite(JSContext *ctx, JSCallSiteData *csd);
1325
1326
static void js_new_callsite_data(JSContext *ctx, JSCallSiteData *csd, JSStackFrame *sf);
@@ -7065,7 +7066,7 @@ static no_inline __exception int __js_poll_interrupts(JSContext *ctx)
7065
7066
if (rt->interrupt_handler(rt, rt->interrupt_opaque)) {
7066
7067
/* XXX: should set a specific flag to avoid catching */
7067
7068
JS_ThrowInternalError(ctx, "interrupted");
7068
- JS_SetUncatchableError (ctx, ctx->rt->current_exception, TRUE);
7069
+ js_set_uncatchable_error (ctx, ctx->rt->current_exception, TRUE);
7069
7070
return -1;
7070
7071
}
7071
7072
}
@@ -10134,7 +10135,7 @@ BOOL JS_IsUncatchableError(JSContext *ctx, JSValue val)
10134
10135
return p->class_id == JS_CLASS_ERROR && p->is_uncatchable_error;
10135
10136
}
10136
10137
10137
- void JS_SetUncatchableError (JSContext *ctx, JSValue val, BOOL flag)
10138
+ static void js_set_uncatchable_error (JSContext *ctx, JSValue val, BOOL flag)
10138
10139
{
10139
10140
JSObject *p;
10140
10141
if (JS_VALUE_GET_TAG(val) != JS_TAG_OBJECT)
@@ -10144,9 +10145,19 @@ void JS_SetUncatchableError(JSContext *ctx, JSValue val, BOOL flag)
10144
10145
p->is_uncatchable_error = flag;
10145
10146
}
10146
10147
10148
+ void JS_SetUncatchableError(JSContext *ctx, JSValue val)
10149
+ {
10150
+ js_set_uncatchable_error(ctx, val, TRUE);
10151
+ }
10152
+
10153
+ void JS_ClearUncatchableError(JSContext *ctx, JSValue val)
10154
+ {
10155
+ js_set_uncatchable_error(ctx, val, FALSE);
10156
+ }
10157
+
10147
10158
void JS_ResetUncatchableError(JSContext *ctx)
10148
10159
{
10149
- JS_SetUncatchableError (ctx, ctx->rt->current_exception, FALSE);
10160
+ js_set_uncatchable_error (ctx, ctx->rt->current_exception, FALSE);
10150
10161
}
10151
10162
10152
10163
int JS_SetOpaque(JSValue obj, void *opaque)
0 commit comments