forked from mirrors/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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user