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

Side by Side Diff: tests/kernel/unsorted/block_scope_test.dart

Issue 2451623006: Reland "Merge more Kernel infrastructure from kernel_sdk SDK fork." (Closed)
Patch Set: Fix Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file.
4
5 // Tests of block scoping.
6
7 import 'expect.dart';
8
9 bool oracle() => true;
10
11 test0() {
12 var x = 'outer', y = x;
13 Expect.isTrue(x == 'outer');
14 Expect.isTrue(y == 'outer');
15 { var x = 'inner';
16 Expect.isTrue(x == 'inner');
17 Expect.isTrue(y == 'outer');
18 }
19 Expect.isTrue(x == 'outer');
20 Expect.isTrue(y == 'outer');
21
22 if (oracle()) {
23 var y = 'inner';
24 Expect.isTrue(x == 'outer');
25 Expect.isTrue(y == 'inner');
26 } else {
27 Expect.isTrue(false);
28 }
29 Expect.isTrue(x == 'outer');
30 Expect.isTrue(y == 'outer');
31 }
32
33 var x = 'toplevel';
34
35 test1() {
36 var y = 'outer';
37 Expect.isTrue(x == 'toplevel');
38 Expect.isTrue(y == 'outer');
39 { var x = 'inner';
40 Expect.isTrue(x == 'inner');
41 Expect.isTrue(y == 'outer');
42 }
43 Expect.isTrue(x == 'toplevel');
44 Expect.isTrue(y == 'outer');
45
46 if (oracle()) {
47 var y = 'inner';
48 Expect.isTrue(x == 'toplevel');
49 Expect.isTrue(y == 'inner');
50 } else {
51 Expect.isTrue(false);
52 }
53 Expect.isTrue(x == 'toplevel');
54 Expect.isTrue(y == 'outer');
55 }
56
57 main() {
58 test0();
59 test1();
60 }
OLDNEW
« no previous file with comments | « tests/kernel/unsorted/as_is_test.dart ('k') | tests/kernel/unsorted/breakable_statement_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698