From kde-commits Thu Jun 17 23:02:19 2004 From: =?utf-8?q?Lu=C3=ADs=20Pedro=20Coelho?= Date: Thu, 17 Jun 2004 23:02:19 +0000 To: kde-commits Subject: kdelibs/khtml/ecma Message-Id: <20040617230219.8E2B09092 () office ! kde ! org> X-MARC-Message: https://marc.info/?l=kde-commits&m=108751335613846 CVS commit by luis_pedro: Correctly handle unparseable javascript (the error logic was wrong). [konqueror was crashing on ] (Reviewed by Zack). M +4 -6 kjs_events.cpp 1.86 --- kdelibs/khtml/ecma/kjs_events.cpp #1.85:1.86 @@ -188,13 +188,11 @@ void JSLazyEventListener::parseCode() co // failed to parse, so let's just make this listener a no-op listener = Object(); - } - - if (!listener.inherits(&DeclaredFunctionImp::info)) { + } else if (!listener.inherits(&DeclaredFunctionImp::info)) { listener = Object();// Error creating function - } - + } else { DeclaredFunctionImp *declFunc = static_cast(listener.imp()); declFunc->setName(Identifier(name)); } + } // no more need to keep the unparsed code around