0ad/source/scriptinterface
wraitii 25490bfec3 Improve JS Exception handling.
- Check for pending exceptions after function calls and script
executions.
- Call LOGERROR instead of JS_ReportError when there is a conversion
error in FromJSVal, since that can only be called from C++ (where JS
errors don't really make sense). Instead, C++ callers of FromJSVal
should handle the failure and, themselves, either report an error or
simply do something else.
- Wrap JS_ReportError since that makes updating it later easier.

This isn't a systematical fix since ToJSVal also ought return a boolean
for failures, and we probably should trigger errors instead of warnings
on 'implicit' conversions, rather a preparation diff.

Part of the SM52 migration, stage: SM45 compatible (actually SM52
incompatible, too).

Based on a patch by: Itms
Comments by: Vladislavbelov, Stan`
Refs #742, #4893

Differential Revision: https://code.wildfiregames.com/D3093
This was SVN commit r24187.
2020-11-15 18:29:17 +00:00
..
tests Improve JS Exception handling. 2020-11-15 18:29:17 +00:00
NativeWrapperDecls.h Mass rename CxPrivate to CmptPrivate. 2020-11-13 16:44:15 +00:00
NativeWrapperDefns.h Improve JS Exception handling. 2020-11-15 18:29:17 +00:00
ScriptContext.cpp Improve JS Exception handling. 2020-11-15 18:29:17 +00:00
ScriptContext.h Improve JS Exception handling. 2020-11-15 18:29:17 +00:00
ScriptConversions.cpp Improve JS Exception handling. 2020-11-15 18:29:17 +00:00
ScriptConversions.h Improve JS Exception handling. 2020-11-15 18:29:17 +00:00
ScriptEngine.h Rename ScriptRuntime to ScriptContext 2020-11-14 10:57:50 +00:00
ScriptExceptions.cpp Improve JS Exception handling. 2020-11-15 18:29:17 +00:00
ScriptExceptions.h Improve JS Exception handling. 2020-11-15 18:29:17 +00:00
ScriptExtraHeaders.h SpiderMonkey 38 upgrade: 09/35 2016-09-02 16:23:44 +00:00
ScriptInterface.cpp Improve JS Exception handling. 2020-11-15 18:29:17 +00:00
ScriptInterface.h Improve JS Exception handling. 2020-11-15 18:29:17 +00:00
ScriptStats.cpp Use in-place construction. 2015-07-29 23:44:17 +00:00
ScriptStats.h Add JS memory usage to profiler. 2010-08-02 19:23:58 +00:00
ScriptTypes.h Upgrade SpiderMonkey to version 45.0.2, refs #4893. 2019-08-07 22:37:43 +00:00