From 809b0c480b68a6ff077589ba562000e14beea055 Mon Sep 17 00:00:00 2001 From: Dan Witte Date: Mon, 19 Jul 2010 11:23:24 -0700 Subject: [PATCH] Remove redundant checks in CClosure::Trace. No bug, r=luke --- js/src/ctypes/CTypes.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/js/src/ctypes/CTypes.cpp b/js/src/ctypes/CTypes.cpp index c2e5a3aec6b6..97942b0405be 100644 --- a/js/src/ctypes/CTypes.cpp +++ b/js/src/ctypes/CTypes.cpp @@ -5080,6 +5080,8 @@ CClosure::Create(JSContext* cx, JSObject* thisObj, PRFuncPtr* fnptr) { + JS_ASSERT(fnObj); + JSObject* result = JS_NewObject(cx, &sCClosureClass, NULL, NULL); if (!result) return NULL; @@ -5183,12 +5185,10 @@ CClosure::Trace(JSTracer* trc, JSObject* obj) // Identify our objects to the tracer. (There's no need to identify // 'closureObj', since that's us.) - if (cinfo->typeObj) - JS_CALL_OBJECT_TRACER(trc, cinfo->typeObj, "typeObj"); + JS_CALL_OBJECT_TRACER(trc, cinfo->typeObj, "typeObj"); + JS_CALL_OBJECT_TRACER(trc, cinfo->jsfnObj, "jsfnObj"); if (cinfo->thisObj) - JS_CALL_OBJECT_TRACER(trc, cinfo->thisObj, "thisObj"); - if (cinfo->jsfnObj) - JS_CALL_OBJECT_TRACER(trc, cinfo->jsfnObj, "jsfnObj"); + JS_CALL_OBJECT_TRACER(trc, cinfo->thisObj, "thisObj"); } void