mirror of
https://gitea.wildfiregames.com/0ad/0ad.git
synced 2026-07-12 05:16:31 +00:00
Makes custom JS objects compatible with SpiderMonkey ESR31.
In v24 you called JS_InitClass and passed in a definition of JSNative functions. Later you could call JS_NewObject with this class and the object would get a prototype with the specified JSNative functions. In ESR31 you now have to explicitly store the prototype object returned by JS_InitClass and pass it as prototype argument to JS_NewObject to achieve the same. This change modifies our existing ScriptInterface implementation for custom object types a bit and uses it at places where the JSAPI was used directly before. Refs #2462 This was SVN commit r15524.
This commit is contained in:
@@ -413,8 +413,8 @@ private:
|
||||
class CustomType
|
||||
{
|
||||
public:
|
||||
JSObject * m_Object;
|
||||
JSClass * m_Class;
|
||||
JSObject* m_Prototype;
|
||||
JSClass* m_Class;
|
||||
JSNative m_Constructor;
|
||||
};
|
||||
void Register(const char* name, JSNative fptr, size_t nargs);
|
||||
|
||||
Reference in New Issue
Block a user