Bug 1063247: Allow implicit construction of JS::ubi::Node from JS::HandleValue. r=terrence
☠☠ backed out by 04be894027e6 ☠ ☠
authorJim Blandy <jimb@mozilla.com>
Fri, 05 Sep 2014 10:43:35 -0700
changeset 203892 dd80b2984fe223054a6189175d4669c8cc09365f
parent 203891 1f6db27e62402d8d9037ee0b4c29a58f8328e5c1
child 203893 c7ffa64956c6fbe1439c905fc3bae0ebe99c2df7
push id48763
push userjblandy@mozilla.com
push dateFri, 05 Sep 2014 17:45:15 +0000
treeherdermozilla-inbound@a6033944c4c1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersterrence
bugs1063247
milestone35.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1063247: Allow implicit construction of JS::ubi::Node from JS::HandleValue. r=terrence This seems reasonable, since a ubi::Node is really just a pointer with some introspection support, so the value and the Node are pretty similar. And I don't see cases where you'd want an error.
js/public/UbiNode.h
js/src/vm/UbiNode.cpp
--- a/js/public/UbiNode.h
+++ b/js/public/UbiNode.h
@@ -266,17 +266,17 @@ class Node {
     }
     template<typename T>
     Node &operator=(const Rooted<T *> &root) {
         construct(root.get());
         return *this;
     }
 
     // Constructors accepting SpiderMonkey's other generic-pointer-ish types.
-    explicit Node(JS::Value value);
+    Node(JS::HandleValue value);
     Node(JSGCTraceKind kind, void *ptr);
 
     // copy construction and copy assignment just use memcpy, since we know
     // instances contain nothing but a vtable pointer and a data pointer.
     //
     // To be completely correct, concrete classes could provide a virtual
     // 'construct' member function, which we could invoke on rhs to construct an
     // instance in our storage. But this is good enough; there's no need to jump
--- a/js/src/vm/UbiNode.cpp
+++ b/js/src/vm/UbiNode.cpp
@@ -47,17 +47,17 @@ Node::Node(JSGCTraceKind kind, void *ptr
       case JSTRACE_BASE_SHAPE:  construct(static_cast<js::BaseShape *>(ptr));         break;
       case JSTRACE_TYPE_OBJECT: construct(static_cast<js::types::TypeObject *>(ptr)); break;
 
       default:
         MOZ_CRASH("bad JSGCTraceKind passed to JS::ubi::Node::Node");
     }
 }
 
-Node::Node(Value value)
+Node::Node(HandleValue value)
 {
     if (value.isObject())
         construct(&value.toObject());
     else if (value.isString())
         construct(value.toString());
     else if (value.isSymbol())
         construct(value.toSymbol());
     else