move remoteCallerID to Script.remoteCallerID

This commit is contained in:
ZappoMan 2017-10-22 17:14:11 -07:00
parent a7e21d7e76
commit 44f8bf00bc

View file

@ -2531,10 +2531,10 @@ void ScriptEngine::callEntityScriptMethod(const EntityItemID& entityID, const QS
args << entityID.toScriptValue(this);
args << qScriptValueFromSequence(this, params);
QScriptValue oldData = this->globalObject().property("remoteCallerID");
this->globalObject().setProperty("remoteCallerID", remoteCallerID.toString()); // Make the remoteCallerID available to javascript as a global.
QScriptValue oldData = this->globalObject().property("Script").property("remoteCallerID");
this->globalObject().property("Script").setProperty("remoteCallerID", remoteCallerID.toString()); // Make the remoteCallerID available to javascript as a global.
callWithEnvironment(entityID, details.definingSandboxURL, entityScript.property(methodName), entityScript, args);
this->globalObject().setProperty("remoteCallerID", oldData);
this->globalObject().property("Script").setProperty("remoteCallerID", oldData);
}
}
}