mirror of
https://gitea.wildfiregames.com/0ad/0ad.git
synced 2026-06-29 13:25:59 +00:00
616fa4a006
`JSNatives` passed to SpiderMonkey must not throw exceptions. Most callbacks are wrapped in `ScriptFunction::ToJSNative`. This commit adds exception handling to `ScriptFunction::ToJSNative` so that exceptions thrown in the wrapped callbacks are catched and rethrown as JavaScript `Error`s.
9 lines
59 B
JavaScript
9 lines
59 B
JavaScript
try
|
|
{
|
|
Engine.callback();
|
|
}
|
|
catch (e)
|
|
{
|
|
log(e.message);
|
|
}
|