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

Side by Side Diff: tests/compiler/dart2js/dart_backend_test.dart

Issue 11416138: [dart2dart] Do not crash on unresolved named constructor (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years 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 | Annotate | Revision Log
« no previous file with comments | « sdk/lib/_internal/compiler/implementation/dart_backend/placeholder_collector.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) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 import 'dart:uri'; 5 import 'dart:uri';
6 import 'parser_helper.dart'; 6 import 'parser_helper.dart';
7 import 'mock_compiler.dart'; 7 import 'mock_compiler.dart';
8 import '../../../sdk/lib/_internal/compiler/compiler.dart'; 8 import '../../../sdk/lib/_internal/compiler/compiler.dart';
9 import '../../../sdk/lib/_internal/compiler/implementation/dart2jslib.dart' as l eg; 9 import '../../../sdk/lib/_internal/compiler/implementation/dart2jslib.dart' as l eg;
10 import '../../../sdk/lib/_internal/compiler/implementation/dart_backend/dart_bac kend.dart'; 10 import '../../../sdk/lib/_internal/compiler/implementation/dart_backend/dart_bac kend.dart';
(...skipping 674 matching lines...) Expand 10 before | Expand all | Expand 10 after
685 fisk.print('corelib'); 685 fisk.print('corelib');
686 print('local'); 686 print('local');
687 } 687 }
688 '''; 688 ''';
689 var expectedResult = "p_print(x){throw 'fisk';}" 689 var expectedResult = "p_print(x){throw 'fisk';}"
690 "main(){print('corelib');p_print('local');}"; 690 "main(){print('corelib');p_print('local');}";
691 testDart2Dart(src, 691 testDart2Dart(src,
692 continuation: (String result) { Expect.equals(expectedResult, result); }); 692 continuation: (String result) { Expect.equals(expectedResult, result); });
693 } 693 }
694 694
695 testUnresolvedNamedConstructor() {
696 var src = '''
697 class A {
698 A() {}
699 }
700
701 main() {
702 new A();
703 new A.named();
704 }
705 ''';
706 var expectedResult = "class A{A(){}}main(){new A();new p_Unresolved();}";
707 testDart2Dart(src,
708 continuation: (String result) { Expect.equals(expectedResult, result); });
709 }
710
695 main() { 711 main() {
696 testSimpleFileUnparse(); 712 testSimpleFileUnparse();
697 testTopLevelField(); 713 testTopLevelField();
698 testSimpleTopLevelClass(); 714 testSimpleTopLevelClass();
699 testClassWithSynthesizedConstructor(); 715 testClassWithSynthesizedConstructor();
700 testClassWithMethod(); 716 testClassWithMethod();
701 testExtendsImplements(); 717 testExtendsImplements();
702 testVariableDefinitions(); 718 testVariableDefinitions();
703 testGetSet(); 719 testGetSet();
704 testAbstractClass(); 720 testAbstractClass();
(...skipping 10 matching lines...) Expand all
715 testClassTypeArgumentBound(); 731 testClassTypeArgumentBound();
716 testDoubleMains(); 732 testDoubleMains();
717 testStaticAccessIoLib(); 733 testStaticAccessIoLib();
718 testLocalFunctionPlaceholder(); 734 testLocalFunctionPlaceholder();
719 testMinification(); 735 testMinification();
720 testClosureLocalsMinified(); 736 testClosureLocalsMinified();
721 testParametersMinified(); 737 testParametersMinified();
722 testDeclarationTypePlaceholders(); 738 testDeclarationTypePlaceholders();
723 testPlatformLibraryMemberNamesAreFixed(); 739 testPlatformLibraryMemberNamesAreFixed();
724 testConflictsWithCoreLib(); 740 testConflictsWithCoreLib();
741 testUnresolvedNamedConstructor();
725 } 742 }
OLDNEW
« no previous file with comments | « sdk/lib/_internal/compiler/implementation/dart_backend/placeholder_collector.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698