Indeed, you are correct that Production Mode can detect a problem when attempting to parse out a null value. This I already knew :) The problem lies a little deeper...
Hopefully others can help me with this pleeeease :)
1) This HostedModeException is very annoying. Null (or in JavaScript terms 'undefined') is a valid value for my JavaScript/JSON attributes. I want a way where if the darn thing is undefined return null... don't throw a HostedModeException - I also tried in jsni if(this.attribute){ return this.attribute; } else { return undefined } but the exception is still thrown.
2) There is no documentation about how this will behave in production? Will it just return null? I don't know how I can ensure consistency between dev and production modes :'(
Thanks for reading :)
2010/8/2 André Moraes <andrebq@gmail.com>
2. According to the GWT doco, these HostedModeException only occur in Dev mode, and never thrown in production mode. So what happens when running in Production Mode?This is because in production mode you are running only JavaScript and javascript don't do typecheck. In dev mode the error happens because it must convert the returned value (undefined in this case) to a valid Java type (int in this case).Here is all the code for my class:--
André Moraes
Analista de Desenvolvimento de Sistemas
andrebq@gmail.com
http://andredevchannel.blogspot.com/
--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to google-web-toolkit+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to google-web-toolkit+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
No comments:
Post a Comment