Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

`in` test JScript compatibility #1630

Closed
satyr opened this Issue · 7 comments

2 participants

Satoshi Murakami Michael Ficarra
Satoshi Murakami
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
Michael Ficarra
Collaborator

How is this coffeescript's responsibility?

Michael Ficarra
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.

Satoshi Murakami
Collaborator

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

Michael Ficarra
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.

Satoshi Murakami
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.

Michael Ficarra
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.