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

Unified Diff: pkg/compiler/lib/src/js_backend/patch_resolver.dart

Issue 2896393003: Remove factory body in *.fromEnvironment, and implement this same behavior (Closed)
Patch Set: turn warning into a hint Created 3 years, 7 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
Index: pkg/compiler/lib/src/js_backend/patch_resolver.dart
diff --git a/pkg/compiler/lib/src/js_backend/patch_resolver.dart b/pkg/compiler/lib/src/js_backend/patch_resolver.dart
index 0dfd302191f10ccbfc9ba88b22a7cc28b9adf2f8..1b2a8707feabbfc7e217ae5511218b6ca3f361fb 100644
--- a/pkg/compiler/lib/src/js_backend/patch_resolver.dart
+++ b/pkg/compiler/lib/src/js_backend/patch_resolver.dart
@@ -34,6 +34,14 @@ class PatchResolverTask extends CompilerTask {
checkMatchingPatchSignatures(element, patch);
element = patch;
} else {
+ if (element.isConstructor) {
+ // Note: currently we allow a couple external methods without a patch,
+ // namely the *.fromEnvironment const constructors in int, bool, and
+ // String. In the future we might also represent native DOM methods in
+ // dart:html this way.
+ ConstructorElementX constructor = element;
+ if (constructor.isFromEnvironmentConstructor) return element;
+ }
reporter.reportErrorMessage(
element, MessageKind.PATCH_EXTERNAL_WITHOUT_IMPLEMENTATION);
}
« no previous file with comments | « pkg/compiler/lib/src/js_backend/mirrors_analysis.dart ('k') | pkg/compiler/lib/src/kernel/element_map_impl.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698