Skip to content

Commit

Permalink
Fix instanceof for primitives & string.
Browse files Browse the repository at this point in the history
Without this change a native type with name="Object"
would return true in an instance of tests against a js boolean, number
or String.

Change-Id: I91e7f32f0d2fd76e842d6c1618160a63e0837aa0
  • Loading branch information
dankurka authored and Gerrit Code Review committed Dec 7, 2015
1 parent 890af91 commit 297d775
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ private static native boolean jsinstanceOf(Object obj, String jsTypeStr) /*-{
if (jsTypeStr == "Object") {
// TODO(rluble): Handle this case in the compiler side.
return true;
return (typeof obj) == "object";
} else if (jsTypeStr == "Array" ) {
// TODO(rluble): remove array special handling once
// instanceOf can be customized for native classes.
Expand Down

0 comments on commit 297d775

Please sign in to comment.