Bug 994159 - Fix typo in OOM check in DefineMetaTypeDescr. r=nmatsakis.
authorJason Orendorff <jorendorff@mozilla.com>
Fri, 25 Apr 2014 11:50:33 -0500
changeset 180605 ac3d60d50ccd112fb7407c2229c086634d5a0b0c
parent 180604 0eb5fefd5ca84ce7185bddbf847197acc6f062ee
child 180606 0436eec4d294f73a424e931945a27fe38cd3e028
push id272
push userpvanderbeken@mozilla.com
push dateMon, 05 May 2014 16:31:18 +0000
reviewersnmatsakis
bugs994159
milestone31.0a1
Bug 994159 - Fix typo in OOM check in DefineMetaTypeDescr. r=nmatsakis.
js/src/builtin/TypedObject.cpp
--- a/js/src/builtin/TypedObject.cpp
+++ b/js/src/builtin/TypedObject.cpp
@@ -1295,17 +1295,17 @@ DefineMetaTypeDescr(JSContext *cx,
     // Create ctor.prototype.prototype, which inherits from Object.__proto__
 
     RootedObject objProto(cx, global->getOrCreateObjectPrototype(cx));
     if (!objProto)
         return nullptr;
     RootedObject protoProto(cx);
     protoProto = NewObjectWithProto<JSObject>(cx, objProto,
                                               global, SingletonObject);
-    if (!proto)
+    if (!protoProto)
         return nullptr;
 
     RootedValue protoProtoValue(cx, ObjectValue(*protoProto));
     if (!JSObject::defineProperty(cx, proto, cx->names().prototype,
                                   protoProtoValue,
                                   nullptr, nullptr,
                                   JSPROP_READONLY | JSPROP_PERMANENT))
         return nullptr;