-
Notifications
You must be signed in to change notification settings - Fork 371
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
instanceof JsObject returns false functions #9347
Comments
should it be typeof == 'object' || typeof == 'function'? |
null and undefined should cast as well but instanceof those should fail. |
Isn't that the current behaviour for null/undefined? On Thu, May 19, 2016 at 7:12 PM, Goktug Gokdogan notifications@github.com
|
Might be, might be not. Needs to be verified since typeof null is 'object' while typeof undefined is 'undefined' so I would be surprised if the current implementation works correctly at the same time for both scenarios. |
Yes. instanceof JsObject will return true for null and false for undefined. On Thu, May 19, 2016 at 7:22 PM, Goktug Gokdogan notifications@github.com
|
I am guessing this needs to be in 2.8 correct? What is left to do here? Go through all cast scenarios in Casts.java and verify that the work as intended? Who is going to do that work? |
We need update the test cases esp. around handling of null and primitives and functions. |
Code is up for review at https://gwt-review.googlesource.com/#/c/15173 |
Bug: gwtproject#9347 Bug-Link: http://github.com/gwtproject/gwt/issues/9347 Change-Id: I4996be8f0b347b696f27763669550cf739729df7
instanceof JsObject returns false functions although instanceof Object returns true.
This because it is special cased to be translated as typeof == 'object' which doesn't return true for all cases.
The text was updated successfully, but these errors were encountered: