You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
...although looking in more detail at the stack overflow exceptions, they're indicative of corrupted bytecode, so InternalError is likely appropriate after all.
Activity
Remove non-standard InternalError exception type
bnoordhuis commentedon May 26, 2026
We use InternalError when the engine breaks down and I don't think it's a good idea to confabulate that kind of error with regular runtime exceptions.
If the idea is to not confuse JS land with non-standard exceptions, then maybe it's better to make it uncatchable.
saghul commentedon May 26, 2026
That was part of the idea yeah.
I took a stab at it in the linked PR, following some practices that other engines seem to do. Things like memory error should likely not be that?
Do you think it's worth it to go with with a fine comb and reduce the usage?
bnoordhuis commentedon May 26, 2026
I count 31 uses of
JS_ThrowInternalError, 3 which might be better as a different kind of exception (2x stack overflow, 1x string too long.)The deserializer throws InternalError in a number of cases but that seems perfectly fine to me, that's non-standard functionality in the first place.
bnoordhuis commentedon May 26, 2026
...although looking in more detail at the stack overflow exceptions, they're indicative of corrupted bytecode, so InternalError is likely appropriate after all.
saghul commentedon May 26, 2026
What does v8 do in similar cases?
bnoordhuis commentedon May 26, 2026
Abort :)
saghul commentedon May 26, 2026
👍 I'm dropping this then.