vishal...@gmail.com
unread,Sep 2, 2011, 2:52:05 PM9/2/11Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Google Web Toolkit
I'm using GWT 2.4.0-rc1 and have hit a possible JS bug (not 100% sure
as I don't have a simple reproducer) and thought it's worth
sharing.
I wrote some Antlr based validation of user input in GWT client and
everything worked fine in debug mode but the compiled JS code never
called the logic that should be executed when there's no error (err =
false in code below)
So the issue is that if I've code like below
boolean err = false
try {
// do something that might fail due to exception
} catch (Throwable e) {
err = true;
// do something to process the error
} finally {
someLogicThatDependyOnErrValue(abc,def,err)
}
Then the generated js code assumes that err will always be false in
finally and pass false as param, i.e it creates
someLogicThatDependyOnErrValue(abc,def,false)
Note that instead or 'err', false is passed
My fix is to improve my needlessly complicated code (must have been
late night)
try {
// do something that might fail due to exception
// We should reach this point only if there's no error
someLogicThatDependyOnErrValue(abc,def,true)
} catch (Throwable e) {
// do something to process the error
}