The following Javascript code (that works in IE) throws an Exception :
var objForm = new Enumerator(document.forms);
for(; !objForm.atEnd(); objForm.moveNext()) {
var objFormItem = new Enumerator(eval('document.forms.' + objForm.item().name));
if(objFormItem.item().type == 'radio') {
...
}
com.gargoylesoftware.htmlunit.ScriptException: Wrapped java.lang.IllegalArgumentException: argument type mismatch at
com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$HtmlUnitContextAction.run(JavaScriptEngine.java:517)
at org.mozilla.javascript.Context.call(Context.java:515)
Enumerator should be modified to accept a parameter Object :
public void jsConstructor(final Object collection) {
collection_ = (HTMLCollection)collection;
}
But then I got :
java.lang.ClassCastException:
com.gargoylesoftware.htmlunit.javascript.host.HTMLFormElement cannot be
cast to com.gargoylesoftware.htmlunit.javascript.host.HTMLCollection
I guess the second Enumerator should enumerate in form elements (inputs).
Fixed in SVN, thanks for testing it before the official 2.5 release :-)