mirror of
https://gitea.wildfiregames.com/0ad/0ad.git
synced 2026-06-21 21:46:09 +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:
@@ -214,7 +214,7 @@ JS::Value deepfreeze(const ScriptInterface& scriptInterface, JS::HandleValue val
|
||||
return JS::UndefinedValue();
|
||||
}
|
||||
|
||||
Script::FreezeObject(rq, val, true);
|
||||
Script::DeepFreezeObject(rq, val);
|
||||
return val;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user