SpiderMonkey 38 upgrade: 14/35

JS_NewObject has no parent or proto arg anymore, use
JS_NewObjectWithGivenProto instead. Patch by leper.
Addresses https://bugzilla.mozilla.org/show_bug.cgi?id=1136906
https://bugzilla.mozilla.org/show_bug.cgi?id=1127443 and
https://bugzilla.mozilla.org/show_bug.cgi?id=1136345

This was SVN commit r18668.
This commit is contained in:
Nicolas Auvray 2016-09-02 16:29:21 +00:00
parent 8d15411abf
commit c3710c9632
2 changed files with 3 additions and 3 deletions

View File

@ -571,7 +571,7 @@ JSObject* ScriptInterface::CreateCustomObject(const std::string& typeName) const
throw PSERROR_Scripting_TypeDoesNotExist();
JS::RootedObject prototype(m->m_cx, it->second.m_Prototype.get());
return JS_NewObject(m->m_cx, (*it).second.m_Class, prototype, JS::NullPtr());
return JS_NewObjectWithGivenProto(m->m_cx, it->second.m_Class, prototype);
}
bool ScriptInterface::CallFunctionVoid(JS::HandleValue val, const char* name)

View File

@ -182,7 +182,7 @@ template<> void ScriptInterface::ToJSVal<CFixedVector3D>(JSContext* cx, JS::Muta
// apply the Vector3D prototype to the return value;
ScriptInterface::CxPrivate* pCxPrivate = ScriptInterface::GetScriptInterfaceAndCBData(cx);
JS::RootedObject proto(cx, &pCxPrivate->pScriptInterface->GetCachedValue(ScriptInterface::CACHE_VECTOR3DPROTO).toObject());
JS::RootedObject obj(cx, JS_NewObject(cx, nullptr, proto, JS::NullPtr()));
JS::RootedObject obj(cx, JS_NewObjectWithGivenProto(cx, nullptr, proto));
if (!obj)
{
@ -229,7 +229,7 @@ template<> void ScriptInterface::ToJSVal<CFixedVector2D>(JSContext* cx, JS::Muta
// apply the Vector2D prototype to the return value
ScriptInterface::CxPrivate* pCxPrivate = ScriptInterface::GetScriptInterfaceAndCBData(cx);
JS::RootedObject proto(cx, &pCxPrivate->pScriptInterface->GetCachedValue(ScriptInterface::CACHE_VECTOR2DPROTO).toObject());
JS::RootedObject obj(cx, JS_NewObject(cx, nullptr, proto, JS::NullPtr()));
JS::RootedObject obj(cx, JS_NewObjectWithGivenProto(cx, nullptr, proto));
if (!obj)
{
ret.setUndefined();