I am having trouble with looping in Javascript
Here is our problem script :
var more = iterator.hasNext(); if (more) { do { var row = iterator.next(); if ( testHelper.test(row) ) { callBack.matches(row, true); } else { callBack.matches(row, false); } } while(iterator.hasNext()) }
Context/Assertions:
1) iterator, callBack and testHelper are Java objects are passed into the Javascript context. 2) testHelper.test() returns boolean true (for the sake of argument)
3) all else is Javascript.
Basically when we morph to ....
if ( testHelper.test(row) ) { callBack.matches(row, true); } else { callBack.matches(row, false); }
....and do the iteration in Java (outside the JavaScript) it all works fine. But given the overhead of instantiation of the Rhino engine for each test, we'd prefer to do the former script.
Anyone have any ideas as to why Rhino barfs with a non-specific exception?
Regards,
- Paul H
-- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>