dart-sdk/pkg/dev_compiler/web
Jenny Messerly 472c898c87 [dartdevc] fix for-in loop variable shadowing a var used in initialzer
Dart for-in loops allow `var x = [1]; for (var x in x) {}`, which is not
allowed in JS. If this pattern is detected, a temporary variable is
introduced so the for-in initializer expression is evaluated outside of
the JS for-of loop.

(This issue seems to be unique to for-in loops. For loops and other
kinds of variable declarations of the form `var x = ...` are not
allowed to use `x` in the initializer, even if `x` is declared in an
outer scope.)

Also fixes an out-of-date comment in the DDC+Analyzer backend.

Change-Id: I35b272a5a311f7b6f104cc82a99cc83a6ed5c247
Reviewed-on: https://dart-review.googlesource.com/c/79142
Commit-Queue: Alan Knight <alanknight@google.com>
Auto-Submit: Jenny Messerly <jmesserly@google.com>
Reviewed-by: Alan Knight <alanknight@google.com>
2018-10-11 17:07:39 +00:00
..
index.html Remove package:browser usage in DDC repl extension code 2018-03-15 01:42:12 +00:00
main.dart Deprecate module-root option in dartdevc, part of #32272 2018-07-26 02:43:48 +00:00
source_map_stack_trace.dart Run dartfmt --fix for dart2 on pkg/dev_compiler 2018-06-15 00:28:13 +00:00
stack_trace_mapper.dart Run dartfmt --fix for dart2 on pkg/dev_compiler 2018-06-15 00:28:13 +00:00
web_command.dart [dartdevc] fix for-in loop variable shadowing a var used in initialzer 2018-10-11 17:07:39 +00:00