| 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(
|
|
|