1
0
forked from 0ad/0ad

SpiderMonkey 38 upgrade: 13/35

Update JS_NewObject to JS_NewPlainObject, with new parameters. Patch by
leper.
Addresses https://bugzilla.mozilla.org/show_bug.cgi?id=1136906 and
https://bugzilla.mozilla.org/show_bug.cgi?id=1125356

This was SVN commit r18667.
This commit is contained in:
Nicolas Auvray 2016-09-02 16:28:17 +00:00
parent c99ae7ca1c
commit 8d15411abf
9 changed files with 16 additions and 16 deletions

View File

@ -1,4 +1,4 @@
/* Copyright (C) 2014 Wildfire Games.
/* Copyright (C) 2016 Wildfire Games.
* This file is part of 0 A.D.
*
* 0 A.D. is free software: you can redistribute it and/or modify
@ -46,7 +46,7 @@ template<> void ScriptInterface::ToJSVal<SDL_Event_>(JSContext* cx, JS::MutableH
default: typeName = "(unknown)"; break;
}
JS::RootedObject obj(cx, JS_NewObject(cx, nullptr, JS::NullPtr(), JS::NullPtr()));
JS::RootedObject obj(cx, JS_NewPlainObject(cx));
if (!obj)
{
ret.setUndefined();
@ -63,7 +63,7 @@ template<> void ScriptInterface::ToJSVal<SDL_Event_>(JSContext* cx, JS::MutableH
// SET(obj, "which", (int)val.ev.key.which); // (not in wsdl.h)
// SET(obj, "state", (int)val.ev.key.state); // (not in wsdl.h)
JS::RootedObject keysym(cx, JS_NewObject(cx, nullptr, JS::NullPtr(), JS::NullPtr()));
JS::RootedObject keysym(cx, JS_NewPlainObject(cx));
if (!keysym)
{
ret.setUndefined();

View File

@ -690,7 +690,7 @@ bool JSI_IGUIObject::getComputedSize(JSContext* cx, uint UNUSED(argc), jsval* vp
e->UpdateCachedSize();
CRect size = e->m_CachedActualSize;
JS::RootedValue objVal(cx, JS::ObjectValue(*JS_NewObject(cx, nullptr, JS::NullPtr(), JS::NullPtr())));
JS::RootedValue objVal(cx, JS::ObjectValue(*JS_NewPlainObject(cx)));
try
{
ScriptInterface* pScriptInterface = ScriptInterface::GetScriptInterfaceAndCBData(cx)->pScriptInterface;

View File

@ -1,4 +1,4 @@
/* Copyright (C) 2014 Wildfire Games.
/* Copyright (C) 2015 Wildfire Games.
* This file is part of 0 A.D.
*
* 0 A.D. is free software: you can redistribute it and/or modify
@ -49,7 +49,7 @@ JS::Value JSI_Mod::GetAvailableMods(ScriptInterface::CxPrivate* pCxPrivate)
ScriptInterface* scriptInterface = pCxPrivate->pScriptInterface;
JSContext* cx = scriptInterface->GetContext();
JSAutoRequest rq(cx);
JS::RootedObject obj(cx, JS_NewObject(cx, nullptr, JS::NullPtr(), JS::NullPtr()));
JS::RootedObject obj(cx, JS_NewPlainObject(cx));
const Paths paths(g_args);

View File

@ -30,7 +30,7 @@ public:
JSContext* cx = script.GetContext();
JSAutoRequest rq(cx);
JS::RootedObject obj(cx, JS_NewObject(cx, nullptr, JS::NullPtr(), JS::NullPtr()));
JS::RootedObject obj(cx, JS_NewPlainObject(cx));
ObjectIdCache<u32> map(g_ScriptRuntime);
map.init();

View File

@ -1,4 +1,4 @@
/* Copyright (C) 2010 Wildfire Games.
/* Copyright (C) 2015 Wildfire Games.
* This file is part of 0 A.D.
*
* 0 A.D. is free software: you can redistribute it and/or modify
@ -33,7 +33,7 @@ JS::Value ICmpFootprint::GetShape_wrapper()
JSContext* cx = GetSimContext().GetScriptInterface().GetContext();
JSAutoRequest rq(cx);
JS::RootedObject obj(cx, JS_NewObject(cx, nullptr, JS::NullPtr(), JS::NullPtr()));
JS::RootedObject obj(cx, JS_NewPlainObject(cx));
if (!obj)
return JS::UndefinedValue();

View File

@ -113,7 +113,7 @@ template<> bool ScriptInterface::FromJSVal<CColor>(JSContext* cx, JS::HandleValu
template<> void ScriptInterface::ToJSVal<CColor>(JSContext* cx, JS::MutableHandleValue ret, CColor const& val)
{
JSAutoRequest rq(cx);
JS::RootedObject obj(cx, JS_NewObject(cx, nullptr, JS::NullPtr(), JS::NullPtr()));
JS::RootedObject obj(cx, JS_NewPlainObject(cx));
if (!obj)
{
ret.setUndefined();
@ -261,7 +261,7 @@ template<> void ScriptInterface::ToJSVal<Grid<u8> >(JSContext* cx, JS::MutableHa
ScriptInterface::ToJSVal(cx, &w, val.m_W);
ScriptInterface::ToJSVal(cx, &h, val.m_H);
JS::RootedObject obj(cx, JS_NewObject(cx, nullptr, JS::NullPtr(), JS::NullPtr()));
JS::RootedObject obj(cx, JS_NewPlainObject(cx));
JS_SetProperty(cx, obj, "width", w);
JS_SetProperty(cx, obj, "height", h);
JS_SetProperty(cx, obj, "data", data);
@ -283,7 +283,7 @@ template<> void ScriptInterface::ToJSVal<Grid<u16> >(JSContext* cx, JS::MutableH
ScriptInterface::ToJSVal(cx, &w, val.m_W);
ScriptInterface::ToJSVal(cx, &h, val.m_H);
JS::RootedObject obj(cx, JS_NewObject(cx, nullptr, JS::NullPtr(), JS::NullPtr()));
JS::RootedObject obj(cx, JS_NewPlainObject(cx));
JS_SetProperty(cx, obj, "width", w);
JS_SetProperty(cx, obj, "height", h);
JS_SetProperty(cx, obj, "data", data);

View File

@ -24,7 +24,7 @@
#define TOJSVAL_SETUP() \
JSContext* cx = scriptInterface.GetContext(); \
JSAutoRequest rq(cx); \
JS::RootedObject obj(cx, JS_NewObject(cx, nullptr, JS::NullPtr(), JS::NullPtr())); \
JS::RootedObject obj(cx, JS_NewPlainObject(cx)); \
if (!obj) \
return JS::UndefinedValue();

View File

@ -38,7 +38,7 @@ CStdDeserializer::CStdDeserializer(ScriptInterface& scriptInterface, std::istrea
// Add a dummy tag because the serializer uses the tag 0 to indicate that a value
// needs to be serialized and then tagged
m_dummyObject = JS_NewObject(cx, nullptr, JS::NullPtr(), JS::NullPtr());
m_dummyObject = JS_NewPlainObject(cx);
m_ScriptBackrefs.push_back(JS::Heap<JSObject*>(m_dummyObject));
}
@ -172,7 +172,7 @@ jsval CStdDeserializer::ReadScriptVal(const char* UNUSED(name), JS::HandleObject
}
else if (type == SCRIPT_TYPE_OBJECT)
{
obj.set(JS_NewObject(cx, nullptr, JS::NullPtr(), JS::NullPtr()));
obj.set(JS_NewPlainObject(cx));
}
else // SCRIPT_TYPE_OBJECT_PROTOTYPE
{

View File

@ -376,7 +376,7 @@ void CParamNode::ConstructJSVal(JSContext* cx, JS::MutableHandleValue ret) const
// Got child nodes - convert this node into a hash-table-style object:
JS::RootedObject obj(cx, JS_NewObject(cx, nullptr, JS::NullPtr(), JS::NullPtr()));
JS::RootedObject obj(cx, JS_NewPlainObject(cx));
if (!obj)
{
ret.setUndefined();