0ad/source/tools
wraitii ee0d204bf6 Wrap JSAutoRequest and replace usage of JSContext* with the wrapper.
JSAutoRequest is required before calling into most JSAPI methods, for GC
reasons.
Calling it is required and fragile as one must not forget.
Further, SM52 and later make manipulating JSContext* dangerous as that
can cross Compartment(Realm in SM68) barriers (and ScriptInterface now
matches a Compartment).

The solution to both problems is to avoid using JSContext* in 0 A.D.
itself. To achieve this, a Request class is introduced, and must be used
to access a JSContext* from a scriptInterface. Further, Request is
passed to other ScriptInterface functions isntead of JSContext*, making
it obvious that the caller has already called it, reducing errors and
redundant JSAutoRequest calls.
Only JSNative functions now get a naked JSContext* without protection,
but the likelihood of forgetting a request is lower since many
ScriptInterface functions now expect it.

JSContext* is directly passed to JSAPI functions only.

Part of the SM52 migration, stage: SM45 compatible

Based on a patch by: Itms
Tested By: Freagarach
Refs #4893

Differential Revision: https://code.wildfiregames.com/D3088
This was SVN commit r24176.
2020-11-13 13:18:22 +00:00
..
atlas Wrap JSAutoRequest and replace usage of JSContext* with the wrapper. 2020-11-13 13:18:22 +00:00
autolog/SVNLog Fix fileendings of files with mixed fileendings in the public mod (except art, l10n) and in source/ (except for source/third_party/). 2016-07-25 12:58:47 +00:00
cmpgraph Add script for generating mostly-useless component interaction graphs. 2011-01-07 20:31:48 +00:00
dist macOS build fixes and Jenkins pipelines. 2020-05-17 14:12:53 +00:00
entdocs Changes various urls to point to the new website and fixes some broken forum urls. 2012-12-11 23:04:03 +00:00
entgraph Fix line endings of all files in source/ except source/third_party/. 2016-07-25 09:07:45 +00:00
entity Check for missing selection textures and missing range overlay textures 2020-03-07 11:06:51 +00:00
fontbuilder2 Fix incorrect README.txt following 849cbc13ee. 2020-11-13 10:50:48 +00:00
i18n Internationalise Damage Types and Status Effects using (optional) JSON files. 2020-05-20 17:26:37 +00:00
lobbybots The files in this path were not marked as moved in 5dce2f1fb1... 2018-11-07 17:32:21 +00:00
mapcompatibility Fixes A19 map converter script to be compatible with Python 2 (uses struct instead of to_bytes and from_bytes) 2015-06-14 17:53:12 +00:00
openlogsfolder Fix line endings of all files in source/ except source/third_party/. 2016-07-25 09:07:45 +00:00
profiler2 Make all Wildfire Games copyright headers consistent by always ending with a period and using (C) instead of (c). 2017-07-10 14:26:24 +00:00
replayprofile Ease comparison of two replay profile graphs by typing the filename in the browser instead of renaming the data.json files, refs #5116. 2018-04-11 16:07:38 +00:00
rlclient/python Add an interface for Reinforcement Learning. 2020-08-01 10:52:59 +00:00
selectiontexgen Pretty unit selection overlay rings. Fixes #824. 2012-04-22 04:04:02 +00:00
springimport Make all Wildfire Games copyright headers consistent by always ending with a period and using (C) instead of (c). 2017-07-10 14:26:24 +00:00
templatesanalyzer Update docs. 2018-09-11 16:33:22 +00:00
templatessorter Templates sorting utility. Closes #801. 2011-07-30 20:20:34 +00:00
tracelogger SpiderMonkey 38 upgrade: 02/35 2016-09-02 16:14:11 +00:00
webservices Fix line endings of all files in source/ except source/third_party/. 2016-07-25 09:07:45 +00:00
xmlvalidator Adds a skip for invalid files in the validator 2017-12-12 20:23:26 +00:00
LICENSE.txt Split XpartaMuPP and EcheLOn into separate directories and rename parent folder to "lobbybots" following 5e643ba6be. 2018-11-07 17:23:56 +00:00