diff --git a/js/public/RootingAPI.h b/js/public/RootingAPI.h index cdaeb56430ff..337ed71a7efc 100644 --- a/js/public/RootingAPI.h +++ b/js/public/RootingAPI.h @@ -384,8 +384,8 @@ class MOZ_NONHEAP_CLASS Handle : public js::HandleBase public: /* Creates a handle from a handle of a type convertible to T. */ template - Handle(Handle handle, - typename mozilla::EnableIf::value, int>::Type dummy = 0) + MOZ_IMPLICIT Handle(Handle handle, + typename mozilla::EnableIf::value, int>::Type dummy = 0) { static_assert(sizeof(Handle) == sizeof(T*), "Handle must be binary compatible with T*."); @@ -428,19 +428,19 @@ class MOZ_NONHEAP_CLASS Handle : public js::HandleBase */ template inline - Handle(const Rooted& root, - typename mozilla::EnableIf::value, int>::Type dummy = 0); + MOZ_IMPLICIT Handle(const Rooted& root, + typename mozilla::EnableIf::value, int>::Type dummy = 0); template inline - Handle(const PersistentRooted& root, - typename mozilla::EnableIf::value, int>::Type dummy = 0); + MOZ_IMPLICIT Handle(const PersistentRooted& root, + typename mozilla::EnableIf::value, int>::Type dummy = 0); /* Construct a read only handle from a mutable handle. */ template inline - Handle(MutableHandle& root, - typename mozilla::EnableIf::value, int>::Type dummy = 0); + MOZ_IMPLICIT Handle(MutableHandle& root, + typename mozilla::EnableIf::value, int>::Type dummy = 0); DECLARE_POINTER_COMPARISON_OPS(T); DECLARE_POINTER_CONSTREF_OPS(T); @@ -792,16 +792,16 @@ class FakeRooted : public RootedBase { public: template - FakeRooted(CX* cx - MOZ_GUARD_OBJECT_NOTIFIER_PARAM) + explicit FakeRooted(CX* cx + MOZ_GUARD_OBJECT_NOTIFIER_PARAM) : ptr(GCMethods::initial()) { MOZ_GUARD_OBJECT_NOTIFIER_INIT; } template - FakeRooted(CX* cx, T initial - MOZ_GUARD_OBJECT_NOTIFIER_PARAM) + explicit FakeRooted(CX* cx, T initial + MOZ_GUARD_OBJECT_NOTIFIER_PARAM) : ptr(initial) { MOZ_GUARD_OBJECT_NOTIFIER_INIT; diff --git a/js/public/UbiNode.h b/js/public/UbiNode.h index 203482a0841c..cd8dc1dffa8b 100644 --- a/js/public/UbiNode.h +++ b/js/public/UbiNode.h @@ -306,7 +306,7 @@ class Node { Node() { construct(nullptr); } template - Node(T* ptr) { + MOZ_IMPLICIT Node(T* ptr) { construct(ptr); } template @@ -317,7 +317,7 @@ class Node { // We can construct and assign from rooted forms of pointers. template - Node(const Rooted& root) { + MOZ_IMPLICIT Node(const Rooted& root) { construct(root.get()); } template diff --git a/js/src/jsapi.h b/js/src/jsapi.h index cffbd8795166..0027fee36da4 100644 --- a/js/src/jsapi.h +++ b/js/src/jsapi.h @@ -525,7 +525,7 @@ class HandleValueArray : length_(values.length()), elements_(values.begin()) {} template - HandleValueArray(const AutoValueArray& values) : length_(N), elements_(values.begin()) {} + MOZ_IMPLICIT HandleValueArray(const AutoValueArray& values) : length_(N), elements_(values.begin()) {} /* CallArgs must already be rooted somewhere up the stack. */ MOZ_IMPLICIT HandleValueArray(const JS::CallArgs& args) : length_(args.length()), elements_(args.array()) {}