mirror of
https://gitea.wildfiregames.com/0ad/0ad.git
synced 2026-06-21 17:06:39 +00:00
Remove all external usage of CmptPrivate. Header cleanup.
This removes usage of CmptPrivate outside of ScriptInterface.
ScriptRequest can now be used to safely recover the scriptInterface from
a JSContext instead of going through ScriptInterface, which allows more
code cleanup.
Follows 34b1920e7b
Differential Revision: https://code.wildfiregames.com/D3963
This was SVN commit r25442.
This commit is contained in:
@@ -55,7 +55,7 @@ template<> void Script::ToJSVal<IComponent*>(const ScriptRequest& rq, JS::Mutab
|
||||
// Otherwise we need to construct a wrapper object
|
||||
// (TODO: cache wrapper objects?)
|
||||
JS::RootedObject obj(rq.cx);
|
||||
if (!val->NewJSObject(*ScriptInterface::GetScriptInterfaceAndCBData(rq.cx)->pScriptInterface, &obj))
|
||||
if (!val->NewJSObject(rq.GetScriptInterface(), &obj))
|
||||
{
|
||||
// Report as an error, since scripts really shouldn't try to use unscriptable interfaces
|
||||
LOGERROR("IComponent does not have a scriptable interface");
|
||||
|
||||
Reference in New Issue
Block a user