mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1223990 - Cleanly throw errors in self-hosted code. (r=till)
This commit is contained in:
parent
bf70a9c34b
commit
3b65667308
@ -542,6 +542,13 @@ js::ErrorToException(JSContext* cx, const char* message, JSErrorReport* reportp,
|
||||
if (JSREPORT_IS_WARNING(reportp->flags))
|
||||
return false;
|
||||
|
||||
// Similarly, we cannot throw a proper object inside the self-hosting
|
||||
// compartment, as we cannot construct the Error constructor without
|
||||
// self-hosted code. Tell our caller to report immediately.
|
||||
// Without self-hosted code, we cannot get started anyway.
|
||||
if (cx->runtime()->isSelfHostingCompartment(cx->compartment()))
|
||||
return false;
|
||||
|
||||
// Find the exception index associated with this error.
|
||||
JSErrNum errorNumber = static_cast<JSErrNum>(reportp->errorNumber);
|
||||
if (!callback)
|
||||
|
Loading…
Reference in New Issue
Block a user