[SM91] Update to Spidermonkey 91.1.3 APIs

Fixes: #5986
Patch by: @wraitii
Comments by: @nwtour, @Stan
Differential Revision: https://code.wildfiregames.com/D4428
This was SVN commit r27409.
This commit is contained in:
Stan
2023-01-10 17:06:47 +00:00
parent 03c3d2d438
commit d5db03c303
11 changed files with 49 additions and 42 deletions
+3 -3
View File
@@ -1,4 +1,4 @@
/* Copyright (C) 2021 Wildfire Games.
/* Copyright (C) 2023 Wildfire Games.
* This file is part of 0 A.D.
*
* 0 A.D. is free software: you can redistribute it and/or modify
@@ -170,13 +170,13 @@ protected:
// The JS code will see undefined when querying a property descriptor.
virtual bool getOwnPropertyDescriptor(JSContext* UNUSED(cx), JS::HandleObject UNUSED(proxy), JS::HandleId UNUSED(id),
JS::MutableHandle<JS::PropertyDescriptor> UNUSED(desc)) const override
JS::MutableHandle<mozilla::Maybe<JS::PropertyDescriptor>> UNUSED(desc)) const override
{
return true;
}
// Throw an exception is JS code attempts defining a property.
virtual bool defineProperty(JSContext* UNUSED(cx), JS::HandleObject UNUSED(proxy), JS::HandleId UNUSED(id),
JS::Handle<JS::PropertyDescriptor> UNUSED(desc), JS::ObjectOpResult& UNUSED(result)) const override
JS::Handle<JS::PropertyDescriptor> UNUSED(desc), JS::ObjectOpResult& UNUSED(result)) const override
{
return false;
}
@@ -1,4 +1,4 @@
/* Copyright (C) 2022 Wildfire Games.
/* Copyright (C) 2023 Wildfire Games.
* This file is part of 0 A.D.
*
* 0 A.D. is free software: you can redistribute it and/or modify
@@ -89,7 +89,7 @@ IGUIObject* IGUIProxyObject::FromPrivateSlot<IGUIObject>(JSObject* obj)
{
if (!obj)
return nullptr;
if (JS_GetClass(obj) != &JSInterface_GUIProxy::ClassDefinition())
if (JS::GetClass(obj) != &JSInterface_GUIProxy::ClassDefinition())
return nullptr;
return UnsafeFromPrivateSlot<IGUIObject>(obj);
}