mirror of
https://gitea.wildfiregames.com/0ad/0ad.git
synced 2026-09-21 20:06:40 +00:00
[SM78 2/2] Update to Spidermonkey 78 APIs
This ugprades 0 A.D. to the latest ESR at the moment of writing. Mostly straighforward API changes (see meta-Bug 1633145) - js::Class is merged with JSClass - JSNewArrayObject becomes JS::NewArrayObject - ArrayObject-functions are moved to a new public header Array.h - JSMSG error messages have again been changed, requiring some tweaks. - AutoValueArray becomes RootedBalueArray (Bug 1634435) - 'uneval' is behind a Realm flag (Bug 1565170), but no removal is planned in the short-term future. - Some minor GC API changes (Bugs 1569564 and 1633405) - Error reporting has had some tweaks, and error flags have been removed (Bug 1620583) - StructuredClone are now always thread-safe, simplifying an API change introduced in SM52 (Bug 1607791) Tested by: Stan, Freagarach, mammadori Closes #5861 Differential Revision: https://code.wildfiregames.com/D3168 This was SVN commit r24333.
This commit is contained in:
@@ -25,7 +25,7 @@
|
||||
|
||||
template<typename T> static void ToJSVal_vector(const ScriptRequest& rq, JS::MutableHandleValue ret, const std::vector<T>& val)
|
||||
{
|
||||
JS::RootedObject obj(rq.cx, JS_NewArrayObject(rq.cx, 0));
|
||||
JS::RootedObject obj(rq.cx, JS::NewArrayObject(rq.cx, 0));
|
||||
if (!obj)
|
||||
{
|
||||
ret.setUndefined();
|
||||
@@ -52,11 +52,11 @@ template<typename T> static bool FromJSVal_vector(const ScriptRequest& rq, JS::H
|
||||
|
||||
bool isArray;
|
||||
obj = &v.toObject();
|
||||
if ((!JS_IsArrayObject(rq.cx, obj, &isArray) || !isArray) && !JS_IsTypedArrayObject(obj))
|
||||
if ((!JS::IsArrayObject(rq.cx, obj, &isArray) || !isArray) && !JS_IsTypedArrayObject(obj))
|
||||
FAIL("Argument must be an array");
|
||||
|
||||
u32 length;
|
||||
if (!JS_GetArrayLength(rq.cx, obj, &length))
|
||||
if (!JS::GetArrayLength(rq.cx, obj, &length))
|
||||
FAIL("Failed to get array length");
|
||||
|
||||
out.reserve(length);
|
||||
|
||||
Reference in New Issue
Block a user