In kernel the loop level wasn't set correctly for for loops, resulting
in the loop variable not always being fresh.
Examples:
```
// Capture the loop variable, ensure we capture the right value.
for (int i = 0; i < 10; i++) { if (i == 7) f = () => "i = $i"; }
print(f());
// There is only one instance of k. The captured variable continues to change.
int k;
for (k = 0; k < 10; k++) { if (k == 7) f = () => "k = $k"; }
print(f());
```
resulted in
i = 10
k = 10
(i.e. it's wrong)
whereas
```
// Capture the loop variable, ensure we capture the right value.
for (int i = 0; i < 10; i++) { if (i == 7) { f = () => "i = $i"; } }
print(f());
{
// There is only one instance of k. The captured variable continues to change.
int k;
for (k = 0; k < 10; k++) { if (k == 7) { f = () => "k = $k"; } }
print(f());
}
```
resultet in
i = 7
k = 10
(i.e. it's correct).
Now both examples produce the correct result.
Change-Id: I1fb4c888c6a0eaa690f62226e093508992b33ed4
Reviewed-on: https://dart-review.googlesource.com/9961
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
This moves Http code into dart:_http. dart:io then imports and
re-exports dart:_http. This is the first stage of moving
dart:_http into its own pub package.
This CL was reverted due to a failure in the Flutter engine build
which happened due to an incomplete change in gen_snapshot.cc, and to
update sdk/lib/libraries.yaml and sdk/lib/libraries.json
Change-Id: Ie90c77ef631aea7a163774b58e8ccbaf71a24d3c
Reviewed-on: https://dart-review.googlesource.com/7588
Reviewed-by: Zach Anderson <zra@google.com>
Reverting for broken Flutter build and kernel platform compilation test. It looks like the new _http library is missing from various snapshots. Not sure why this didn't fail locally.
This reverts commit ac9ff3f3af.
Change-Id: I7fbc2f842cf1380793e7af9fb869cacd14682885
Reviewed-on: https://dart-review.googlesource.com/7600
Reviewed-by: Zach Anderson <zra@google.com>
This moves Http code into dart:_http. dart:io then imports and
re-exports dart:_http. This is the first stage of moving
dart:_http into its own pub package.
Change-Id: Icd33232a97b3d75511ef7ec88b01fd47cdcf5a23
Reviewed-on: https://dart-review.googlesource.com/6420
Reviewed-by: Siva Annamalai <asiva@google.com>
Reviewed-by: Florian Loitsch <floitsch@google.com>
Adjusted lib_2/mirrors/initializing_formals_test.dart to match new rule
for static checking on type annotations of initializing formals.
Added language_2/initializing_formals_type_annotation_test.dart to
check the 4 main situations directly.
Change-Id: Icf763c79c99274645f7967b8c3e3a3c3f6536763
Reviewed-on: https://dart-review.googlesource.com/7268
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Erik Ernst <eernst@google.com>
Some changes were required to stream_transformer_test to make it strong
mode clean. Other minor changes involved migrating from unittest->test.
Bug:
Change-Id: Ia21144090710137e4803c651cf9e3fd62e17f5f7
Reviewed-on: https://dart-review.googlesource.com/3707
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Fixed some errors in other_declarations_location_test, removed checks
for TypeError when passing invalid arguments to a method in
private_symbol_test.
Bug:
Change-Id: I82030f1189a7a370d15bef4fd284d92b0b2de5bb
Reviewed-on: https://dart-review.googlesource.com/3791
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Also share (almost identicial) code between
error_at_exit_spawn_test.dart
error_at_exit_spawnuri_test.dart
in
error_at_exit_spawning_shared.dart
Converted 3 tests away from package:unittest to use package:async_helper/package:expect.
Change-Id: I1b9bf7c895eb21f3c5be9246e69b784296610ce3
Reviewed-on: https://dart-review.googlesource.com/5261
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
This CL silences several tests for '$compiler = dartkp' configuration
in order to make vm-kernel-precomp-* buildbots greener.
These tests are already silenced for '$compiler = precompiler' or
'$compiler = dartk' configurations.
Change-Id: Ia3208853655868ae4cf39775d40db15218c1a1df
Reviewed-on: https://dart-review.googlesource.com/5286
Reviewed-by: Alexander Aprelev <aam@google.com>
Mirrors are not supported in precompiler/AOT, so all lib_2/mirrors/*
tests should be skipped for '$compiler = dartkp' configuration, like
they are skipped for '$compiler = precompiler' configuration in
lib_2_precompiled.status.
Change-Id: I65322c700375168b105d5e659de284216bc49f11
Reviewed-on: https://dart-review.googlesource.com/5281
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Migrated tests from unittest->test, updated status files for tests that
are now passing.
Bug:
Change-Id: Ie116d2e39ba472c6c0ae8dec9d6ba100364a6bcc
Reviewed-on: https://dart-review.googlesource.com/3706
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
lazy_static_test needed a field changed from var -> dynamic. Otherwise,
simple block.
Bug:
Change-Id: I5d685b5802da906d22f524466eb6794b75c0da62
Reviewed-on: https://dart-review.googlesource.com/3784
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Updated invoke_call_through* tests to make them strong mode clean, which
mostly involved changing var -> dynamic in some places.
Bug:
Change-Id: I3ac946bdfadd09d6459c7f104068be4cb0c49c1d
Reviewed-on: https://dart-review.googlesource.com/3781
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>