Bug 568466 - TM: avoid premature NULL check in NewXMLQName(). r=gal.
authorNicholas Nethercote <nnethercote@mozilla.com>
Wed, 09 Jun 2010 19:40:12 -0700
changeset 47429 aafbaa9daac48c32a128db788f1b907955c5d506
parent 47427 99ce939d454577b7d90fddc5ba670bf0be227661
child 47430 2164d3ca17def306c739a6179b9aaff4f1d7a6e9
push id1
push userroot
push dateTue, 26 Apr 2011 22:38:44 +0000
treeherdermozilla-beta@bfdb6e623a36 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgal
bugs568466
milestone1.9.3a5pre
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 568466 - TM: avoid premature NULL check in NewXMLQName(). r=gal.
js/src/jsxml.cpp
--- a/js/src/jsxml.cpp
+++ b/js/src/jsxml.cpp
@@ -450,22 +450,20 @@ InitXMLQName(JSObject *obj, JSString *ur
     if (localName)
         obj->setQNameLocalName(STRING_TO_JSVAL(localName));
 }
 
 static JSObject *
 NewXMLQName(JSContext *cx, JSString *uri, JSString *prefix, JSString *localName,
             JSClass *clasp = &js_QNameClass.base)
 {
-    JSObject *obj;
-
-    obj = NewObject(cx, clasp, NULL, NULL);
-    JS_ASSERT(obj->isQName());
+    JSObject *obj = NewObject(cx, clasp, NULL, NULL);
     if (!obj)
         return NULL;
+    JS_ASSERT(obj->isQName());
     InitXMLQName(obj, uri, prefix, localName);
     METER(xml_stats.qname);
     return obj;
 }
 
 JSObject *
 js_ConstructXMLQNameObject(JSContext *cx, jsval nsval, jsval lnval)
 {