`in` test JScript compatibility #1630

Closed
satyr opened this Issue Aug 26, 2011 · 7 comments

Comments

Projects
None yet
2 participants
Collaborator

satyr commented Aug 26, 2011

$ cat in.co
(console?.log or (x) -> WSH.echo ''+x) undefined in Array 1

$ coffee -c in.co && cscript in.js
true

$ coffee in.co
false
Collaborator

michaelficarra commented Aug 26, 2011

How is this coffeescript's responsibility?

Collaborator

michaelficarra commented Aug 26, 2011

That doesn't help. in is a shorthand for a cached Array::indexOf call. If somebody uses Array::indexOf in an implementation that doesn't have proper support for it and gets the wrong result, that should be no surprise to them.

Collaborator

satyr commented Aug 26, 2011

Why then do we provide fallbacks at all? "Sorry, binary in doesn't work on old engines" should work fine in that logic.

Collaborator

michaelficarra commented Aug 26, 2011

We provide fallbacks in case the native method doesn't exist. If it does exist but has a buggy implementation, that's not our problem. We can't do a runtime test-262 run to make sure each native method is compliant before using a fallback.

Collaborator

satyr commented Aug 26, 2011

We provide fallbacks in case the native method doesn't exist. If it does exist but has a buggy implementation, that's not our problem

I don't follow. JScript doesn't have [].indexOf.

Collaborator

michaelficarra commented Aug 26, 2011

Oh, so it's a bug in our fallback then? I see.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment