Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(41)

Issue 8490019: Capturing for loop variables correctly (Closed)

Created:
9 years, 1 month ago by hausner
Modified:
9 years, 1 month ago
Reviewers:
regis
CC:
reviews_dartlang.org
Visibility:
Public.

Description

Capturing for loop variables correctly Re-introduce a "fresh copy" of the for loop variable(s) in each iteration. Adding a minimal test to check that closures capture the value of the particular loop iteration. Committed: https://code.google.com/p/dart/source/detail?r=1273

Patch Set 1 #

Total comments: 4

Patch Set 2 : '' #

Unified diffs Side-by-side diffs Delta from patch set Stats (+102 lines, -0 lines) Patch
M runtime/vm/ast.h View 2 chunks +16 lines, -0 lines 0 comments Download
M runtime/vm/ast_printer.cc View 1 chunk +5 lines, -0 lines 0 comments Download
M runtime/vm/code_generator.h View 1 chunk +1 line, -0 lines 0 comments Download
M runtime/vm/code_generator.cc View 1 1 chunk +17 lines, -0 lines 0 comments Download
M runtime/vm/code_generator_ia32.cc View 1 1 chunk +11 lines, -0 lines 0 comments Download
M runtime/vm/parser.cc View 1 1 chunk +12 lines, -0 lines 0 comments Download
M tests/language/language.status View 1 2 chunks +2 lines, -0 lines 0 comments Download
A tests/language/src/For2Test.dart View 1 chunk +38 lines, -0 lines 0 comments Download

Messages

Total messages: 3 (0 generated)
hausner
9 years, 1 month ago (2011-11-07 22:17:17 UTC) #1
regis
LGTM http://codereview.chromium.org/8490019/diff/1/runtime/vm/code_generator.cc File runtime/vm/code_generator.cc (right): http://codereview.chromium.org/8490019/diff/1/runtime/vm/code_generator.cc#newcode294 runtime/vm/code_generator.cc:294: // Make a copy of the given context, ...
9 years, 1 month ago (2011-11-07 22:31:47 UTC) #2
hausner
9 years, 1 month ago (2011-11-07 22:36:35 UTC) #3
Thank you!

http://codereview.chromium.org/8490019/diff/1/runtime/vm/code_generator.cc
File runtime/vm/code_generator.cc (right):

http://codereview.chromium.org/8490019/diff/1/runtime/vm/code_generator.cc#ne...
runtime/vm/code_generator.cc:294: // Make a copy of the given context, including
the value of the captured
On 2011/11/07 22:31:47, regis wrote:
> values

Done.

http://codereview.chromium.org/8490019/diff/1/runtime/vm/parser.cc
File runtime/vm/parser.cc (right):

http://codereview.chromium.org/8490019/diff/1/runtime/vm/parser.cc#newcode4373
runtime/vm/parser.cc:4373: init_scope->VariableAt(i)->owner() == init_scope) {
On 2011/11/07 22:31:47, regis wrote:
> missing parenthesis

Done.

Powered by Google App Engine
This is Rietveld 408576698