Skip to content
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

Prevent Array.prototype.toString from interfering with other modules #69

Merged
merged 1 commit into from Jan 26, 2012

Conversation

bilts
Copy link
Contributor

@bilts bilts commented Jan 20, 2012

The CoffeeScript compiler depends on the output from Array::toString
being formatted in a specific way. Our changes, which wrapped the
output in square brackets, were causing the CoffeeScript compiler to
double-wrap some arrays (particularly the ones returned by player
strategies).

This commit makes it so that the change to Array::toString is applied
when the program enters Dominiate's top-level API methods and is
reverted when program control leaves those methods.

Fixes #56
Fixes #59

The CoffeeScript compiler depends on the output from Array::toString
being formatted in a specific way.  Our changes, which wrapped the
output in square brackets, were causing the CoffeeScript compiler to
double-wrap some arrays (particularly the ones returned by player
strategies).

This commit makes it so that the change to Array::toString is applied
when the program enters Dominiate's top-level API methods and is
reverted when program control leaves those methods.

Fixes rspeer#56
Fixes rspeer#59
rspeer pushed a commit that referenced this pull request Jan 26, 2012
Prevent Array.prototype.toString from interfering with other modules
@rspeer rspeer merged commit 1ed45d0 into rspeer:master Jan 26, 2012
@rspeer
Copy link
Owner

rspeer commented Jan 26, 2012

Thank you so much.

I should keep in mind that the problem with deep JavaScript magic is that it might react badly with other deep JavaScript magic.

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.

Strategies run forever and buy nothing Command line client incompatible with CoffeeScript v1.2.0
2 participants