diff --git a/dom/bindings/TypedArray.h b/dom/bindings/TypedArray.h index 60ea3992f9e..83e55b7e89e 100644 --- a/dom/bindings/TypedArray.h +++ b/dom/bindings/TypedArray.h @@ -211,9 +211,10 @@ class TypedArrayCreator : mArray(aArray) {} - JSObject* Create(JSContext* aCx, JS::Handle aCreator) const + JSObject* Create(JSContext* aCx) const { - return TypedArrayType::Create(aCx, aCreator, mArray.Length(), mArray.Elements()); + return TypedArrayType::Create(aCx, JS::NullPtr(), mArray.Length(), + mArray.Elements()); } private: diff --git a/dom/promise/Promise.cpp b/dom/promise/Promise.cpp index 6c3e2638a38..897013f0d3b 100644 --- a/dom/promise/Promise.cpp +++ b/dom/promise/Promise.cpp @@ -1105,7 +1105,6 @@ PromiseReportRejectFeature::Notify(JSContext* aCx, workers::Status aStatus) bool Promise::ArgumentToJSValue(const nsAString& aArgument, JSContext* aCx, - JSObject* aScope, JS::MutableHandle aValue) { // XXXkhuey I'd love to use xpc::NonVoidStringToJsval here, but it requires @@ -1126,7 +1125,6 @@ Promise::ArgumentToJSValue(const nsAString& aArgument, bool Promise::ArgumentToJSValue(bool aArgument, JSContext* aCx, - JSObject* aScope, JS::MutableHandle aValue) { aValue.setBoolean(aArgument); diff --git a/dom/promise/Promise.h b/dom/promise/Promise.h index 503c12ff3a9..b03028e7c6f 100644 --- a/dom/promise/Promise.h +++ b/dom/promise/Promise.h @@ -79,7 +79,7 @@ public: // Helpers for using Promise from C++. // Most DOM objects are handled already. To add a new type T, such as ints, - // or dictionaries, add an ArgumentToJSVal overload below. + // or dictionaries, add an ArgumentToJSValue overload below. template void MaybeResolve(T& aArg) { MaybeSomething(aArg, &Promise::MaybeResolve); @@ -209,14 +209,12 @@ private: bool ArgumentToJSValue(const nsAString& aArgument, JSContext* aCx, - JSObject* aScope, JS::MutableHandle aValue); // Accept booleans. bool ArgumentToJSValue(bool aArgument, JSContext* aCx, - JSObject* aScope, JS::MutableHandle aValue); // Accept objects that inherit from nsWrapperCache and nsISupports (e.g. most @@ -226,7 +224,6 @@ private: IsBaseOf::value, bool>::Type ArgumentToJSValue(T& aArgument, JSContext* aCx, - JSObject* aScope, JS::MutableHandle aValue) { return WrapNewBindingObject(aCx, aArgument, aValue); @@ -237,12 +234,9 @@ private: typename EnableIf::value, bool>::Type ArgumentToJSValue(const TypedArrayCreator& aArgument, JSContext* aCx, - JSObject* aScope, JS::MutableHandle aValue) { - JS::RootedObject scope(aCx, aScope); - - JSObject* abv = aArgument.Create(aCx, scope); + JSObject* abv = aArgument.Create(aCx); if (!abv) { return false; } @@ -257,10 +251,9 @@ private: IsBaseOf::value, bool>::Type ArgumentToJSValue(T& aArgument, JSContext* aCx, - JSObject* aScope, JS::MutableHandle aValue) { - JS::Rooted scope(aCx, aScope); + JS::Rooted scope(aCx, JS::CurrentGlobalOrNull(aCx)); nsresult rv = nsContentUtils::WrapNative(aCx, scope, &aArgument, aValue); return NS_SUCCEEDED(rv); @@ -270,10 +263,9 @@ private: bool ArgumentToJSValue(const SmartPtr& aArgument, JSContext* aCx, - JSObject* aScope, JS::MutableHandle aValue) { - return ArgumentToJSValue(*aArgument.get(), aCx, aScope, aValue); + return ArgumentToJSValue(*aArgument.get(), aCx, aValue); } template @@ -288,7 +280,7 @@ private: JSAutoCompartment ac(cx, wrapper); JS::Rooted val(cx); - if (!ArgumentToJSValue(aArgument, cx, wrapper, &val)) { + if (!ArgumentToJSValue(aArgument, cx, &val)) { HandleException(cx); return; }