Backed out 2 changesets (bug 871315) because different compilers have different standards on what is and is not C++

Backed out changeset d0d2e13e8b83 (bug 871315)
Backed out changeset be3976bd2d57 (bug 871315)

Landed on a CLOSED TREE
This commit is contained in:
Ehsan Akhgari 2013-05-13 14:42:03 -04:00
parent 3307a8e159
commit 7c06c8a034
10 changed files with 23 additions and 23 deletions

View File

@ -858,10 +858,11 @@ nsEventListenerManager::CompileEventHandlerInternal(nsListenerStruct *aListenerS
options.setFileAndLine(url.get(), lineNo)
.setVersion(SCRIPTVERSION_DEFAULT);
JS::Rooted<JSObject*> handlerFun(cx);
result = nsJSUtils::CompileFunction(cx, JS::NullPtr(), options,
JS::RootedObject rootedNull(cx, nullptr); // See bug 781070.
JSObject *handlerFun = nullptr;
result = nsJSUtils::CompileFunction(cx, rootedNull, options,
nsAtomCString(aListenerStruct->mTypeAtom),
argCount, argNames, *body, handlerFun.address());
argCount, argNames, *body, &handlerFun);
NS_ENSURE_SUCCESS(result, result);
handler = handlerFun;
NS_ENSURE_TRUE(handler, NS_ERROR_FAILURE);

View File

@ -95,7 +95,7 @@ nsEventListenerInfo::GetJSVal(JSContext* aCx,
nsCOMPtr<nsIJSEventListener> jsl = do_QueryInterface(mListener);
if (jsl) {
JS::Handle<JSObject*> handler(jsl->GetHandler().Ptr()->Callable());
JSObject *handler = jsl->GetHandler().Ptr()->Callable();
if (handler) {
aAc.construct(aCx, handler);
*aJSVal = OBJECT_TO_JSVAL(handler);

View File

@ -1566,9 +1566,9 @@ HTMLMediaElement::GetMozSampleRate(uint32_t* aMozSampleRate)
}
// Helper struct with arguments for our hash iterator.
typedef struct MOZ_STACK_CLASS {
typedef struct {
JSContext* cx;
JS::HandleObject tags;
JSObject* tags;
bool error;
} MetadataIterCx;

View File

@ -1163,8 +1163,8 @@ UndoManager::DispatchTransactionEvent(JSContext* aCx, const nsAString& aType,
nsCOMArray<nsIVariant> keepAlive;
nsTArray<nsIVariant*> transactionItems;
for (uint32_t i = 0; i < items.Length(); i++) {
JS::Rooted<JS::Value> txVal(aCx, JS::ObjectValue(*items[i]->Callback()));
if (!JS_WrapValue(aCx, txVal.address())) {
JS::Value txVal = JS::ObjectValue(*items[i]->Callback());
if (!JS_WrapValue(aCx, &txVal)) {
aRv.Throw(NS_ERROR_OUT_OF_MEMORY);
return;
}

View File

@ -3122,8 +3122,8 @@ nsGenericHTMLElement::GetItemValue(JSContext* aCx, JSObject* aScope,
}
if (ItemScope()) {
JS::Rooted<JS::Value> v(aCx);
if (!mozilla::dom::WrapObject(aCx, scope, this, v.address())) {
JS::Value v;
if (!mozilla::dom::WrapObject(aCx, scope, this, &v)) {
aError.Throw(NS_ERROR_FAILURE);
return JS::UndefinedValue();
}

View File

@ -177,8 +177,8 @@ nsXBLProtoImpl::InitTargetObjects(nsXBLPrototypeBinding* aBinding,
AutoPushJSContext cx(aContext->GetNativeContext());
JS::Rooted<JSObject*> global(cx, sgo->GetGlobalJSObject());
nsCOMPtr<nsIXPConnectJSObjectHolder> wrapper;
JS::Rooted<JS::Value> v(cx);
rv = nsContentUtils::WrapNative(cx, global, aBoundElement, v.address(),
JS::Value v;
rv = nsContentUtils::WrapNative(cx, global, aBoundElement, &v,
getter_AddRefs(wrapper));
NS_ENSURE_SUCCESS(rv, rv);

View File

@ -3653,9 +3653,8 @@ XULDocument::ExecuteScript(nsIScriptContext * aContext, JSScript* aScriptObject)
NS_ENSURE_TRUE(mScriptGlobalObject, NS_ERROR_NOT_INITIALIZED);
// Execute the precompiled script with the given version
JS::Rooted<JSScript*> script(aContext->GetNativeContext(), aScriptObject);
JSObject* global = mScriptGlobalObject->GetGlobalJSObject();
return aContext->ExecuteScript(script, global);
return aContext->ExecuteScript(aScriptObject, global);
}
nsresult

View File

@ -1397,14 +1397,14 @@ nsXULTemplateBuilder::InitHTMLTemplateRoot()
if (mDB) {
// database
JS::Rooted<JS::Value> jsdatabase(jscontext);
JS::Value jsdatabase;
rv = nsContentUtils::WrapNative(jscontext, scope, mDB,
&NS_GET_IID(nsIRDFCompositeDataSource),
jsdatabase.address(), getter_AddRefs(wrapper));
&jsdatabase, getter_AddRefs(wrapper));
NS_ENSURE_SUCCESS(rv, rv);
bool ok;
ok = JS_SetProperty(jscontext, jselement, "database", jsdatabase.address());
ok = JS_SetProperty(jscontext, jselement, "database", &jsdatabase);
NS_ASSERTION(ok, "unable to set database property");
if (! ok)
return NS_ERROR_FAILURE;
@ -1412,16 +1412,16 @@ nsXULTemplateBuilder::InitHTMLTemplateRoot()
{
// builder
JS::Rooted<JS::Value> jsbuilder(jscontext);
JS::Value jsbuilder;
nsCOMPtr<nsIXPConnectJSObjectHolder> wrapper;
rv = nsContentUtils::WrapNative(jscontext, jselement,
static_cast<nsIXULTemplateBuilder*>(this),
&NS_GET_IID(nsIXULTemplateBuilder),
jsbuilder.address(), getter_AddRefs(wrapper));
&jsbuilder, getter_AddRefs(wrapper));
NS_ENSURE_SUCCESS(rv, rv);
bool ok;
ok = JS_SetProperty(jscontext, jselement, "builder", jsbuilder.address());
ok = JS_SetProperty(jscontext, jselement, "builder", &jsbuilder);
if (! ok)
return NS_ERROR_FAILURE;
}

View File

@ -1754,8 +1754,8 @@ nsGlobalWindow::UnmarkGrayTimers()
Function* f = timeout->mScriptHandler->GetCallback();
if (f) {
// Callable() already does xpc_UnmarkGrayObject.
DebugOnly<JS::Handle<JSObject*> > o = f->Callable();
MOZ_ASSERT(!xpc_IsGrayGCThing(o.value), "Should have been unmarked");
DebugOnly<JSObject*> o = f->Callable();
MOZ_ASSERT(!xpc_IsGrayGCThing(o), "Should have been unmarked");
}
}
}

View File

@ -31,7 +31,7 @@ public:
MOZ_ASSERT(JS_ObjectIsCallable(nullptr, aCallable));
}
JS::Handle<JSObject*> Callable() const
JSObject* Callable() const
{
return Callback();
}