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

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

Issue 1417103002: Add ElementKind for factory constructors. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Updated cf. comments. Created 5 years, 2 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/backend.dart
diff --git a/pkg/compiler/lib/src/js_backend/backend.dart b/pkg/compiler/lib/src/js_backend/backend.dart
index 4d4490cf6b4946a24eb7fb6fbc6c13d5cc1229e2..13b0690b005262c654e290b3a5f5339f48505f7b 100644
--- a/pkg/compiler/lib/src/js_backend/backend.dart
+++ b/pkg/compiler/lib/src/js_backend/backend.dart
@@ -2528,7 +2528,7 @@ class JavaScriptBackend extends Backend {
}
void onElementResolved(Element element, TreeElements elements) {
- if ((element.isFunction || element.isGenerativeConstructor) &&
+ if ((element.isFunction || element.isConstructor) &&
annotations.noInline(element)) {
inlineCache.markAsNonInlinable(element);
}
@@ -2566,10 +2566,11 @@ class JavaScriptBackend extends Backend {
inlineCache.markAsNonInlinable(element);
} else if (cls == noThrowsClass) {
hasNoThrows = true;
- if (!Elements.isStaticOrTopLevelFunction(element)) {
+ if (!Elements.isStaticOrTopLevelFunction(element) &&
+ !element.isFactoryConstructor) {
reporter.internalError(element,
"@NoThrows() is currently limited to top-level"
- " or static functions");
+ " or static functions and factory constructors.");
}
if (VERBOSE_OPTIMIZER_HINTS) {
reporter.reportHintMessage(
« no previous file with comments | « pkg/compiler/lib/src/inferrer/type_graph_inferrer.dart ('k') | pkg/compiler/lib/src/parser/member_listener.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698