Skip to content

Replace "instanceof Array" in transformer with "[object Array]" comparison#3985

Merged
michaelficarra merged 1 commit intojashkenas:masterfrom
ide:array-check
Jun 5, 2015
Merged

Replace "instanceof Array" in transformer with "[object Array]" comparison#3985
michaelficarra merged 1 commit intojashkenas:masterfrom
ide:array-check

Conversation

@ide
Copy link
Copy Markdown
Contributor

@ide ide commented May 21, 2015

Testing with '[object Array]' is Object::toString.call element allows arrays from another JS context to be properly handled. The specific use case here is to support jest, which sets up JS contexts using Node/io.js's "vm" module. This approach works in ES3 environments in contrast with ES5's Array.isArray.

…rison

Testing with `'[object Array]' is Object::toString.call element` allows arrays from another JS context to be properly handled. The specific use case here is to support jest, which sets up JS contexts using Node/io.js's "vm" module. This approach works in ES3 environments in contrast with ES5's `Array.isArray`.
@lydell
Copy link
Copy Markdown
Collaborator

lydell commented May 21, 2015

In #3984 you also changed browser.coffee, but you haven't here. Is that intentional?

@ide
Copy link
Copy Markdown
Contributor Author

ide commented May 21, 2015

Yeah, since I didn't have a need for it and I didn't expect browser.coffee to run in a Node vm context (which was having trouble with instanceof Array in the first place).

@michaelficarra
Copy link
Copy Markdown
Collaborator

LGTM.

@DmitrySoshnikov
Copy link
Copy Markdown

Is it a good to go for merge? There is a dependency where we wait for this PR.

michaelficarra added a commit that referenced this pull request Jun 5, 2015
Replace "instanceof Array" in transformer with "[object Array]" comparison
@michaelficarra michaelficarra merged commit 1f197fc into jashkenas:master Jun 5, 2015
@DmitrySoshnikov
Copy link
Copy Markdown

Thanks!

@ide ide deleted the array-check branch June 16, 2015 20:55
EsrefDurna pushed a commit to EsrefDurna/coffeescript that referenced this pull request Nov 12, 2025
Replace "instanceof Array" in transformer with "[object Array]" comparison
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants