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

Side by Side Diff: lib/kernel.dart

Issue 2117513002: More extensive error handling for 'unresolved' cases. (Closed) Base URL: git@github.com:dart-lang/rasta.git@master
Patch Set: Clean up 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
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.md file. 3 // BSD-style license that can be found in the LICENSE.md file.
4 4
5 library rasta.kernel; 5 library rasta.kernel;
6 6
7 import 'dart:async' show 7 import 'dart:async' show
8 Future; 8 Future;
9 9
10 import 'dart:collection' show 10 import 'dart:collection' show
(...skipping 625 matching lines...) Expand 10 before | Expand all | Expand 10 after
636 } 636 }
637 637
638 bool get isInternalStateConsistent { 638 bool get isInternalStateConsistent {
639 if (workQueue.isNotEmpty) { 639 if (workQueue.isNotEmpty) {
640 print("Kernel workQueue isn't empty."); 640 print("Kernel workQueue isn't empty.");
641 return false; 641 return false;
642 } 642 }
643 return compiler.isInternalStateConsistent; 643 return compiler.isInternalStateConsistent;
644 } 644 }
645 645
646 ir.Procedure getUnresolvedConstructorBuilder() { 646 ir.Procedure getDartCoreMethod(String name) {
647 LibraryElement internal = 647 LibraryElement library =
648 compiler.libraryLoader.lookupLibrary(Uri.parse("dart:core")); 648 compiler.libraryLoader.lookupLibrary(Uri.parse("dart:core"));
649 FunctionElement function = 649 Element function = library.implementation.localLookup(name);
650 internal.implementation.localLookup("_unresolvedConstructorError");
651 return functionToIr(function); 650 return functionToIr(function);
652 } 651 }
653 652
654 ir.Procedure getMalformedTypeErrorBuilder() { 653 ir.Procedure getMalformedTypeErrorBuilder() {
655 LibraryElement internal = 654 return getDartCoreMethod('_malformedTypeError');
656 compiler.libraryLoader.lookupLibrary(Uri.parse("dart:core")); 655 }
657 FunctionElement function = 656
658 internal.implementation.localLookup("_malformedTypeError"); 657 ir.Procedure getUnresolvedConstructorBuilder() {
659 return functionToIr(function); 658 return getDartCoreMethod('_unresolvedConstructorError');
659 }
660
661 ir.Procedure getUnresolvedStaticGetterBuilder() {
662 return getDartCoreMethod('_unresolvedStaticGetterError');
663 }
664
665 ir.Procedure getUnresolvedStaticSetterBuilder() {
666 return getDartCoreMethod('_unresolvedStaticSetterError');
667 }
668
669 ir.Procedure getUnresolvedStaticMethodBuilder() {
670 return getDartCoreMethod('_unresolvedStaticMethodError');
671 }
672
673 ir.Procedure getUnresolvedTopLevelGetterBuilder() {
674 return getDartCoreMethod('_unresolvedTopLevelGetterError');
675 }
676
677 ir.Procedure getUnresolvedTopLevelSetterBuilder() {
678 return getDartCoreMethod('_unresolvedTopLevelSetterError');
679 }
680
681 ir.Procedure getUnresolvedTopLevelMethodBuilder() {
682 return getDartCoreMethod('_unresolvedTopLevelMethodError');
683 }
684
685 ir.Procedure getUnresolvedSuperGetterBuilder() {
686 return getDartCoreMethod('_unresolvedSuperGetterError');
687 }
688
689 ir.Procedure getUnresolvedSuperSetterBuilder() {
690 return getDartCoreMethod('_unresolvedSuperSetterError');
691 }
692
693 ir.Procedure getUnresolvedSuperMethodBuilder() {
694 return getDartCoreMethod('_unresolvedSuperMethodError');
695 }
696
697 ir.Procedure getGenericNoSuchMethodBuilder() {
698 return getDartCoreMethod('_genericNoSuchMethod');
660 } 699 }
661 } 700 }
662 701
663 class ConstructorTarget { 702 class ConstructorTarget {
664 final ConstructorElement element; 703 final ConstructorElement element;
665 final DartType type; 704 final DartType type;
666 705
667 ConstructorTarget(this.element, this.type); 706 ConstructorTarget(this.element, this.type);
668 707
669 String toString() => "ConstructorTarget($element, $type)"; 708 String toString() => "ConstructorTarget($element, $type)";
670 } 709 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698