Typo fixes for previous patch, r=jwalden
authorTom Schuster <evilpies@gmail.com>
Mon, 11 Apr 2011 10:48:28 -0700
changeset 67944 19df46c13176
parent 67943 43cef42964d7
child 67945 eee087772f45
push id19455
push usercleary@mozilla.com
push date2011-04-12 03:42 +0000
treeherdermozilla-central@d208845094bf [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjwalden
milestone2.2a1pre
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
Typo fixes for previous patch, r=jwalden
js/src/jsapi.cpp
js/src/jsxml.cpp
--- a/js/src/jsapi.cpp
+++ b/js/src/jsapi.cpp
@@ -2959,17 +2959,17 @@ JS_SetPrivate(JSContext *cx, JSObject *o
 {
     obj->setPrivate(data);
     return true;
 }
 
 JS_PUBLIC_API(void *)
 JS_GetInstancePrivate(JSContext *cx, JSObject *obj, JSClass *clasp, jsval *argv)
 {
-    if (JS_InstanceOf(cx, obj, clasp, argv))
+    if (!JS_InstanceOf(cx, obj, clasp, argv))
         return NULL;
     return obj->getPrivate();
 }
 
 JS_PUBLIC_API(JSObject *)
 JS_GetPrototype(JSContext *cx, JSObject *obj)
 {
     JSObject *proto;
--- a/js/src/jsxml.cpp
+++ b/js/src/jsxml.cpp
@@ -7523,16 +7523,17 @@ GetXMLFunction(JSContext *cx, JSObject *
 
 static JSXML *
 GetPrivate(JSContext *cx, JSObject *obj, const char *method)
 {
     if (!obj->isXML()) {
         JS_ReportErrorNumber(cx, js_GetErrorMessage, NULL,
                              JSMSG_INCOMPATIBLE_METHOD,
                              js_XML_str, method, obj->getClass()->name);
+        return NULL;
     }
     return (JSXML *)obj->getPrivate();
 }
 
 JSBool
 js_GetXMLDescendants(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
 {
     JSXML *xml, *list;