1
0
forked from mirrors/0ad

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:
Itms
2024-11-17 16:25:17 +01:00
committed by Nicolas Auvray
parent e765a2c4ba
commit adcb9755ff
10 changed files with 53 additions and 17 deletions
+1 -1
View File
@@ -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;
}