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

Side by Side Diff: pkg/analyzer/test/generated/all_the_rest_test.dart

Issue 2067843002: ExitDetector: Don't short-circuit return on non-exiting case statements (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Addressing comments Created 4 years, 6 months 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
« no previous file with comments | « pkg/analyzer/lib/src/generated/resolver.dart ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 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. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 library analyzer.test.generated.all_the_rest_test; 5 library analyzer.test.generated.all_the_rest_test;
6 6
7 import 'package:analyzer/dart/ast/ast.dart'; 7 import 'package:analyzer/dart/ast/ast.dart';
8 import 'package:analyzer/dart/ast/token.dart'; 8 import 'package:analyzer/dart/ast/token.dart';
9 import 'package:analyzer/dart/element/element.dart'; 9 import 'package:analyzer/dart/element/element.dart';
10 import 'package:analyzer/dart/element/type.dart'; 10 import 'package:analyzer/dart/element/type.dart';
(...skipping 4015 matching lines...) Expand 10 before | Expand all | Expand 10 after
4026 if (1 < 2) { 4026 if (1 < 2) {
4027 break x; 4027 break x;
4028 } 4028 }
4029 return; 4029 return;
4030 } 4030 }
4031 } 4031 }
4032 '''); 4032 ''');
4033 _assertNthStatementDoesNotExit(source, 0); 4033 _assertNthStatementDoesNotExit(source, 0);
4034 } 4034 }
4035 4035
4036 void test_whileStatement_switchWithBreakWithLabel() {
4037 Source source = addSource(r'''
4038 void f() {
4039 x: while (true) {
4040 switch (true) {
4041 case false: break;
4042 case true: break x;
4043 }
4044 }
4045 }
4046 ''');
4047 _assertNthStatementDoesNotExit(source, 0);
4048 }
4049
4036 void test_whileStatement_breakWithLabel_afterExting() { 4050 void test_whileStatement_breakWithLabel_afterExting() {
4037 Source source = addSource(r''' 4051 Source source = addSource(r'''
4038 void f() { 4052 void f() {
4039 x: while (true) { 4053 x: while (true) {
4040 return; 4054 return;
4041 if (1 < 2) { 4055 if (1 < 2) {
4042 break x; 4056 break x;
4043 } 4057 }
4044 } 4058 }
4045 } 4059 }
(...skipping 430 matching lines...) Expand 10 before | Expand all | Expand 10 after
4476 expect(UriKind.fromEncoding(0x70), same(UriKind.PACKAGE_URI)); 4490 expect(UriKind.fromEncoding(0x70), same(UriKind.PACKAGE_URI));
4477 expect(UriKind.fromEncoding(0x58), same(null)); 4491 expect(UriKind.fromEncoding(0x58), same(null));
4478 } 4492 }
4479 4493
4480 void test_getEncoding() { 4494 void test_getEncoding() {
4481 expect(UriKind.DART_URI.encoding, 0x64); 4495 expect(UriKind.DART_URI.encoding, 0x64);
4482 expect(UriKind.FILE_URI.encoding, 0x66); 4496 expect(UriKind.FILE_URI.encoding, 0x66);
4483 expect(UriKind.PACKAGE_URI.encoding, 0x70); 4497 expect(UriKind.PACKAGE_URI.encoding, 0x70);
4484 } 4498 }
4485 } 4499 }
OLDNEW
« no previous file with comments | « pkg/analyzer/lib/src/generated/resolver.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698