Skip to content

Conversation

@zdenko
Copy link
Collaborator

@zdenko zdenko commented Feb 3, 2018

Fixes #4882.

@vendethiel
Copy link
Collaborator

We've long hidden the index from the user. Did we change that in the previous PR?

@GeoffreyBooth
Copy link
Collaborator

GeoffreyBooth commented Feb 3, 2018

Let’s please add some tests. I would think you could copy the example from the bug report and check if global.i is defined, or maybe make the test function "use strict"?

@zdenko
Copy link
Collaborator Author

zdenko commented Feb 3, 2018

@vendethiel the previous PR (#4855) changed variable declaration of the index, e.g. i:

# before
i = o.scope.freeVariable 'i', single: true

#after
i = o.scope.freeVariable 'i', single: true, reserve: no

The former declared i in the global scope.

The other thing, which I didn't notice before, but #4882 has found, is the different output of the for statement between range with number literals ([0..50]) and variables ([0..a]) in Range::compileArray.

@GeoffreyBooth GeoffreyBooth merged commit ba09412 into jashkenas:master Feb 4, 2018
@GeoffreyBooth GeoffreyBooth mentioned this pull request Feb 5, 2018
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.

3 participants