Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

`in` test JScript compatibility #1630

Closed
satyr opened this Issue · 7 comments

2 participants

@satyr
Collaborator
$ 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
@michaelficarra
Collaborator

How is this coffeescript's responsibility?

@michaelficarra
Collaborator

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.

@satyr
Collaborator

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

@michaelficarra
Collaborator

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.

@satyr
Collaborator

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.

@michaelficarra
Collaborator

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
Something went wrong with that request. Please try again.