mirror of
https://gitea.wildfiregames.com/0ad/0ad.git
synced 2026-06-26 21:47:49 +00:00
Refactor freezing of JS objects
- Shallow-freezing of objects is never used in our codebase, so remove that code path. - Deep-freeze is bugged in recent versions of SpiderMonkey (see bug https://bugzilla.mozilla.org/show_bug.cgi?id=1930258). Until a fix and/or a better API is provided, reimplement this feature by recusively freezing object properties. - Add tests for the deepfreeze function.
This commit is contained in:
@@ -73,7 +73,7 @@ template<> void Script::ToJSVal<CParamNode>(const ScriptRequest& rq, JS::Mutabl
|
||||
// Prevent modifications to the object, so that it's safe to share between
|
||||
// components and to reconstruct on deserialization
|
||||
if (ret.isObject())
|
||||
Script::FreezeObject(rq, ret, true);
|
||||
Script::DeepFreezeObject(rq, ret);
|
||||
}
|
||||
|
||||
template<> void Script::ToJSVal<const CParamNode*>(const ScriptRequest& rq, JS::MutableHandleValue ret, const CParamNode* const& val)
|
||||
|
||||
Reference in New Issue
Block a user