Skip to content
This repository has been archived by the owner on Apr 22, 2023. It is now read-only.

v8: fix let bindings in for loops #23948

Closed
wants to merge 2 commits into from

Conversation

misterdjules
Copy link

This PR:

They are in two separate commits so that every time we float the patch, we don't float the test too.

This PR is based off another PR that downgrades V8 to the actual proper stable version for node v0.12, which is the reason why there are more commits than the two highlighted above.

Once #18206 lands, this PR will be rebased on top of v0.12 and will only include these two commits.

Fixes #9113 and #14411.

/cc @joyent/node-coreteam and especially @mhdawson.

@misterdjules misterdjules changed the title Fix issue 9113 v8: fix let bindings in for loops Apr 28, 2015
@misterdjules misterdjules added this to the 0.12.3 milestone Apr 28, 2015
@cjihrig
Copy link

cjihrig commented Apr 29, 2015

The test LGTM. The floating patch appears to be correct.

@misterdjules
Copy link
Author

Thank you @cjihrig!

ajklein and others added 2 commits April 29, 2015 17:04
Backport b17eaaa5755e625493c5fe537f42b58838923c52 from upstream v8.

Original commit message:
  Fix desugaring of let bindings in for loops to handle continue properly

  This requires putting the original loop's body inside an inner for loop (with
  the same labels as the original loop) and re-binding the temp variables in its
  "next" expression. A second flag is added to the desugared code to ensure the
  loop body executes at most once per loop.

  BUG=v8:3683
  LOG=y

  Review URL: https://codereview.chromium.org/720863002

  Cr-Commit-Position: refs/heads/master@{nodejs#25363}

Fixes nodejs#9113 and nodejs#14411.
0724602 floats a patch on V8 that fixes
issue nodejs#9113 that would cause let bindings and continue statements in for
loops to not work properly.

This change adds a regression test that fails if that patch is not
properly floated, thus preventing us from not floating that patch after
future V8 upgrades.
@misterdjules
Copy link
Author

Rebased on top of v0.12, landing soon.

misterdjules pushed a commit that referenced this pull request Apr 30, 2015
Backport b17eaaa5755e625493c5fe537f42b58838923c52 from upstream v8.

Original commit message:
  Fix desugaring of let bindings in for loops to handle continue properly

  This requires putting the original loop's body inside an inner for loop (with
  the same labels as the original loop) and re-binding the temp variables in its
  "next" expression. A second flag is added to the desugared code to ensure the
  loop body executes at most once per loop.

  BUG=v8:3683
  LOG=y

  Review URL: https://codereview.chromium.org/720863002

  Cr-Commit-Position: refs/heads/master@{#25363}

Fixes #9113 and #14411.

Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
PR-URL: #23948
misterdjules pushed a commit that referenced this pull request Apr 30, 2015
0724602 floats a patch on V8 that fixes
issue #9113 that would cause let bindings and continue statements in for
loops to not work properly.

This change adds a regression test that fails if that patch is not
properly floated, thus preventing us from not floating that patch after
future V8 upgrades.

Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
PR-URL: #23948
@misterdjules
Copy link
Author

Landed in 2a5f4bd and cb55a05.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants