From: SourceForge.net <no...@so...> - 2007-09-27 16:46:18
|
Bugs item #1802969, was opened at 2007-09-26 12:14 Message generated for change (Comment added) made by kor_nielsen You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=448266&aid=1802969&group_id=47038 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: None Group: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: Kor Nielsen (kor_nielsen) Assigned to: Nobody/Anonymous (nobody) Summary: HTMLCollection.call() returns NOT_FOUND rather than null Initial Comment: The following javascript expression returns false, when it should return true: document.all('elementThatDoesNotExist') == null This also results in a warning from rhino: RHINO USAGE WARNING: Missed Context.javaToJS() conversion: Rhino runtime detected object org.mozilla.javascript.UniqueTag@b1074a: NOT_FOUND of class org.mozilla.javascript.UniqueTag where it expected String, Number, Boolean or Scriptable instance. Please check your code for missing Context.javaToJS() call. This is happening because HTMLCollection.call() returns NOT_FOUND rather than null when an item does not exist. I have attached a patch which fixes the problem and includes a unit test to reproduce it. ---------------------------------------------------------------------- >Comment By: Kor Nielsen (kor_nielsen) Date: 2007-09-27 10:46 Message: Logged In: YES user_id=1899485 Originator: YES I don't think htmlunit allows you to use document.all with firefox. I ran my unit test with BrowserVersion.FIREFOX_2, and received this error: com.gargoylesoftware.htmlunit.ScriptException: TypeError: Cannot find function all. ---------------------------------------------------------------------- Comment By: Marc Guillemot (mguillem) Date: 2007-09-27 02:29 Message: Logged In: YES user_id=402164 Originator: NO you're right for document.all for IE but for instance FF supports document.all too and returns undefined (ie NOT_FOUND for Rhino). Therefore, yes it should be fixed but I guess that you're patch isn't fine grained enough. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=448266&aid=1802969&group_id=47038 |