0ad/source/simulation2/components/tests
wraitii dad2857538 Use Symbols to store JS object references when serialising and delete ObjectIDCache
When serialising JS objects, we keep track of any encountered object,
and serialize it only once. Any further serialisation instead stores an
ID referring to the original object (essentially an opaque pointer).
The trouble of course is to have a unique, persistent identifier for
such an object.
svn uses an ObjectIDCache, essentially a "JS Object -> ID" map (which
internally is essentially a "JS heap pointer -> ID" map).

JS, since ES15, includes a "Symbol" primitive type, which is a unique,
immutable identifier. They are also not iterable by for..in or
GetOwnPropertyName or related.
This means they can be used to store the tag directly on the object
(since it's impossible overwrite a user property).
Thanks to this, we can forgo ObjectIDCache in the serializers, and since
following D2897 it becomes unused, we can delete it, along with the
Finalization code it used.


Part of SM52 migration, stage: SM45-compatible changes.

Patch by: Itms
Tested By: Freagarach
Refs #4893

Differential Revision: https://code.wildfiregames.com/D3085
This was SVN commit r24167.
2020-11-12 06:40:19 +00:00
..
test_CinemaManager.h Adds basic tests for the CinemaManager component 2017-11-24 22:38:03 +00:00
test_CommandQueue.h Use Symbols to store JS object references when serialising and delete ObjectIDCache 2020-11-12 06:40:19 +00:00
test_HierPathfinder.h Move LOS to a los helper header and cleanup Grid.h includes. 2020-06-14 20:39:03 +00:00
test_ObstructionManager.h Improve splash damage falloff calculation to account for obstruction size. 2020-08-31 15:01:04 +00:00
test_Pathfinder.h Move LOS to a los helper header and cleanup Grid.h includes. 2020-06-14 20:39:03 +00:00
test_Position.h Rename cmpPosition's IsFloating to CanFloat. 2017-09-18 09:54:54 +00:00
test_RangeManager.h Fix 4edcf21b98. Refs #5428 2019-04-10 06:05:34 +00:00
test_scripts.h Skip and warn about globalscripts and random map tests following 077c4f2576 and 0a6db43c83 when testing without public mod present or if the respective folders don't exist. 2020-04-23 12:06:56 +00:00
test_TerritoryManager.h Pass some strings and a vector as const refs. 2017-02-24 17:02:10 +00:00