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

Unified 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: Merge and update test expectations 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « lib/accessors.dart ('k') | lib/kernel_visitor.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/kernel.dart
diff --git a/lib/kernel.dart b/lib/kernel.dart
index 075d42070c44d7b3c7342710b7eeb61251191d74..0910767a17ad4e1bde5d89bf3ed1c85b118246d5 100644
--- a/lib/kernel.dart
+++ b/lib/kernel.dart
@@ -598,20 +598,59 @@ class Kernel {
return compiler.isInternalStateConsistent;
}
- ir.Procedure getUnresolvedConstructorBuilder() {
- LibraryElement internal =
+ ir.Procedure getDartCoreMethod(String name) {
+ LibraryElement library =
compiler.libraryLoader.lookupLibrary(Uri.parse("dart:core"));
- FunctionElement function =
- internal.implementation.localLookup("_unresolvedConstructorError");
+ Element function = library.implementation.localLookup(name);
return functionToIr(function);
}
ir.Procedure getMalformedTypeErrorBuilder() {
- LibraryElement internal =
- compiler.libraryLoader.lookupLibrary(Uri.parse("dart:core"));
- FunctionElement function =
- internal.implementation.localLookup("_malformedTypeError");
- return functionToIr(function);
+ return getDartCoreMethod('_malformedTypeError');
+ }
+
+ ir.Procedure getUnresolvedConstructorBuilder() {
+ return getDartCoreMethod('_unresolvedConstructorError');
+ }
+
+ ir.Procedure getUnresolvedStaticGetterBuilder() {
+ return getDartCoreMethod('_unresolvedStaticGetterError');
+ }
+
+ ir.Procedure getUnresolvedStaticSetterBuilder() {
+ return getDartCoreMethod('_unresolvedStaticSetterError');
+ }
+
+ ir.Procedure getUnresolvedStaticMethodBuilder() {
+ return getDartCoreMethod('_unresolvedStaticMethodError');
+ }
+
+ ir.Procedure getUnresolvedTopLevelGetterBuilder() {
+ return getDartCoreMethod('_unresolvedTopLevelGetterError');
+ }
+
+ ir.Procedure getUnresolvedTopLevelSetterBuilder() {
+ return getDartCoreMethod('_unresolvedTopLevelSetterError');
+ }
+
+ ir.Procedure getUnresolvedTopLevelMethodBuilder() {
+ return getDartCoreMethod('_unresolvedTopLevelMethodError');
+ }
+
+ ir.Procedure getUnresolvedSuperGetterBuilder() {
+ return getDartCoreMethod('_unresolvedSuperGetterError');
+ }
+
+ ir.Procedure getUnresolvedSuperSetterBuilder() {
+ return getDartCoreMethod('_unresolvedSuperSetterError');
+ }
+
+ ir.Procedure getUnresolvedSuperMethodBuilder() {
+ return getDartCoreMethod('_unresolvedSuperMethodError');
+ }
+
+ ir.Procedure getGenericNoSuchMethodBuilder() {
+ return getDartCoreMethod('_genericNoSuchMethod');
}
}
« no previous file with comments | « lib/accessors.dart ('k') | lib/kernel_visitor.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698