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

Side by Side Diff: tests/compiler/dart2js/serialization/test_data.dart

Issue 2116483002: Handle constant ?? expressions in constructors. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 4 years, 5 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 | « tests/compiler/dart2js/constant_expression_test.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) 2016, the Dart project authors. Please see the AUTHORS file 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 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 dart2js.serialization_test_data; 5 library dart2js.serialization_test_data;
6 6
7 const List<Test> TESTS = const <Test>[ 7 const List<Test> TESTS = const <Test>[
8 const Test('Empty program', const { 8 const Test('Empty program', const {
9 'main.dart': 'main() {}' 9 'main.dart': 'main() {}'
10 }), 10 }),
(...skipping 437 matching lines...) Expand 10 before | Expand all | Expand 10 after
448 ''', 448 ''',
449 }, preserializedSourceFiles: const { 449 }, preserializedSourceFiles: const {
450 'a.dart': ''' 450 'a.dart': '''
451 class A { 451 class A {
452 final field1; 452 final field1;
453 const A(a) : this.field1 = a + 1.0; 453 const A(a) : this.field1 = a + 1.0;
454 } 454 }
455 ''', 455 ''',
456 }), 456 }),
457 457
458 const Test('If-null expression in constant constructor', const {
459 'main.dart': '''
460 import 'a.dart';
461
462 main() {
463 const A(1.0);
464 }
465 ''',
466 }, preserializedSourceFiles: const {
467 'a.dart': '''
468 class A {
469 final field1;
470 const A(a) : this.field1 = a ?? 1.0;
471 }
472 ''',
473 }),
474
458 const Test('Index set if null', const { 475 const Test('Index set if null', const {
459 'main.dart': ''' 476 'main.dart': '''
460 import 'a.dart'; 477 import 'a.dart';
461 478
462 main() => m(null, null, null); 479 main() => m(null, null, null);
463 ''', 480 ''',
464 }, preserializedSourceFiles: const { 481 }, preserializedSourceFiles: const {
465 'a.dart': ''' 482 'a.dart': '''
466 m(a, b, c) => a[b] ??= c; 483 m(a, b, c) => a[b] ??= c;
467 ''', 484 ''',
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
552 const Test( 569 const Test(
553 this.name, 570 this.name,
554 this.sourceFiles, 571 this.sourceFiles,
555 {this.preserializedSourceFiles, 572 {this.preserializedSourceFiles,
556 this.unserializedSourceFiles, 573 this.unserializedSourceFiles,
557 this.expectedErrorCount: 0, 574 this.expectedErrorCount: 0,
558 this.expectedWarningCount: 0, 575 this.expectedWarningCount: 0,
559 this.expectedHintCount: 0, 576 this.expectedHintCount: 0,
560 this.expectedInfoCount: 0}); 577 this.expectedInfoCount: 0});
561 } 578 }
OLDNEW
« no previous file with comments | « tests/compiler/dart2js/constant_expression_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698