Bug 1271653 - Fix SPIDERMONKEY_PROMISE errors in Debugger.cpp;r=till
authorEddy Bruel <ejpbruel@mozilla.com>
Fri, 13 May 2016 16:07:48 +0200
changeset 297401 2ff220d4ffed0902acc637344441e7313c314769
parent 297400 bf84ee87c062eb85084ec3d56f8a439987b5d62d
child 297402 6a50a177ebef2b99751b519df44de186e0c41833
push id19218
push userkwierso@gmail.com
push dateFri, 13 May 2016 23:46:15 +0000
treeherderfx-team@93d60e9db618 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstill
bugs1271653
milestone49.0a1
Bug 1271653 - Fix SPIDERMONKEY_PROMISE errors in Debugger.cpp;r=till
js/src/vm/Debugger.cpp
--- a/js/src/vm/Debugger.cpp
+++ b/js/src/vm/Debugger.cpp
@@ -8091,20 +8091,20 @@ DebuggerObject_getPromiseID(JSContext* c
     return true;
 }
 
 static bool
 DebuggerObject_getPromiseDependentPromises(JSContext* cx, unsigned argc, Value* vp)
 {
     THIS_DEBUGOBJECT_OWNER_PROMISE(cx, argc, vp, "get promiseDependentPromises", args, dbg, refobj);
 
-    Rooted<GCVector<Value>> values(cx, GCVector<Value>());
+    Rooted<GCVector<Value>> values(cx, GCVector<Value>(cx));
     {
         JSAutoCompartment ac(cx, promise);
-        if (!promise->dependentPromises(cx, values))
+        if (!promise->dependentPromises(cx, &values))
             return false;
     }
     for (size_t i = 0; i < values.length(); i++) {
         if (!dbg->wrapDebuggeeValue(cx, values[i]))
             return false;
     }
     RootedArrayObject promises(cx);
     if (values.length() == 0)
@@ -8839,17 +8839,17 @@ DebuggerObject::initClass(JSContext* cx,
     RootedObject objProto(cx, global->getOrCreateObjectPrototype(cx));
 
     RootedNativeObject objectProto(cx, InitClass(cx, debugCtor, objProto, &class_,
                                                  DebuggerObject_construct, 0, properties_,
                                                  methods_, nullptr, nullptr));
 
 #ifdef SPIDERMONKEY_PROMISE
     if (!DefinePropertiesAndFunctions(cx, objectProto, promiseProperties_, nullptr))
-        return false;
+        return nullptr;
 #endif // SPIDERMONKEY_PROMISE
 
     return objectProto;
 }
 
 /* static */ DebuggerObject*
 DebuggerObject::create(JSContext* cx, HandleObject proto, HandleObject referent,
                        HandleNativeObject debugger)
@@ -9425,21 +9425,16 @@ JS_DefineDebuggerObject(JSContext* cx, H
                             nullptr, nullptr);
     if (!sourceProto)
         return false;
 
     objectProto = DebuggerObject::initClass(cx, obj, debugCtor);
     if (!objectProto)
         return false;
 
-#ifdef SPIDERMONKEY_PROMISE
-    if (!DefinePropertiesAndFunctions(cx, objectProto, DebuggerObject::promiseProperties_, nullptr))
-        return false;
-#endif // SPIDERMONKEY_PROMISE
-
     envProto = InitClass(cx, debugCtor, objProto, &DebuggerEnv_class,
                          DebuggerEnv_construct, 0,
                          DebuggerEnv_properties, DebuggerEnv_methods,
                          nullptr, nullptr);
     if (!envProto)
         return false;
 
     memoryProto = InitClass(cx, debugCtor, objProto, &DebuggerMemory::class_,