Replace JS_THIS_OBJECT and JS::CallReceiver in preparation for SpiderMonkey 49 and 61.

Differential Revision: https://code.wildfiregames.com/D2173
Refs #4893, D1699, D2142, D844, 7c2e9027c2, ...
Refs https://bugzilla.mozilla.org/show_bug.cgi?id=1270977
Refs https://bugzilla.mozilla.org/show_bug.cgi?id=1255800
Tested on: clang 8, VS2015, Jenkins

This was SVN commit r22661.
This commit is contained in:
elexis
2019-08-13 14:11:43 +00:00
parent 8dc425be5d
commit 64e80471d0
6 changed files with 75 additions and 76 deletions
+3 -7
View File
@@ -1,4 +1,4 @@
/* Copyright (C) 2017 Wildfire Games.
/* Copyright (C) 2019 Wildfire Games.
* This file is part of 0 A.D.
*
* 0 A.D. is free software: you can redistribute it and/or modify
@@ -132,9 +132,7 @@ BOOST_PP_REPEAT(SCRIPT_INTERFACE_MAX_ARGS, OVERLOADS, ~)
{ \
JS::CallArgs args = JS::CallArgsFromVp(argc, vp); \
JSAutoRequest rq(cx); \
JS::RootedObject thisObj(cx, JS_THIS_OBJECT(cx, vp)); \
if (ScriptInterface::GetClass(thisObj) != CLS) return false; \
TC* c = static_cast<TC*>(ScriptInterface::GetPrivate(thisObj)); \
TC* c = ScriptInterface::GetPrivate<TC>(cx, args, CLS); \
if (! c) return false; \
BOOST_PP_REPEAT_##z (i, CONVERT_ARG, ~) \
JS::RootedValue rval(cx); \
@@ -152,9 +150,7 @@ BOOST_PP_REPEAT(SCRIPT_INTERFACE_MAX_ARGS, OVERLOADS, ~)
{ \
JS::CallArgs args = JS::CallArgsFromVp(argc, vp); \
JSAutoRequest rq(cx); \
JS::RootedObject thisObj(cx, JS_THIS_OBJECT(cx, vp)); \
if (ScriptInterface::GetClass(thisObj) != CLS) return false; \
TC* c = static_cast<TC*>(ScriptInterface::GetPrivate(thisObj)); \
TC* c = ScriptInterface::GetPrivate<TC>(cx, args, CLS); \
if (! c) return false; \
BOOST_PP_REPEAT_##z (i, CONVERT_ARG, ~) \
JS::RootedValue rval(cx); \