-
Notifications
You must be signed in to change notification settings - Fork 664
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
Fix #576 for Array when having ports with tuples #585
Conversation
@@ -210,6 +210,10 @@ Elm.Native.Utils.make = function(elm) { | |||
return Tuple2(posx, posy); | |||
} | |||
|
|||
function isJSArray(a) { | |||
return Array.isArray(a); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where is this function defined?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It 's in the JS standard library: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/isArray
But I just saw that instanceof
should be used, because a could be Null
. I'll change this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like null instanceof Array
is also false. I suspect that using instanceof
is faster and it's definitely clearer to me, so I support the change. Should this function ever return true for null
though?
Should be good to go! :-) |
Cool, thank you! :D |
Fix #576 for Array when having ports with tuples
No description provided.