Index: pkg/compiler/lib/src/diagnostics/messages.dart |
diff --git a/pkg/compiler/lib/src/diagnostics/messages.dart b/pkg/compiler/lib/src/diagnostics/messages.dart |
index 347b25b54cd2b88e1154884f07d4e5ae2191dc7d..edaf69c59f405ccc4df53c4f31b64890885cd0b0 100644 |
--- a/pkg/compiler/lib/src/diagnostics/messages.dart |
+++ b/pkg/compiler/lib/src/diagnostics/messages.dart |
@@ -275,6 +275,8 @@ enum MessageKind { |
INVALID_UNNAMED_CONSTRUCTOR_NAME, |
INVALID_URI, |
INVALID_USE_OF_SUPER, |
+ JS_INTEROP_CLASS_CANNOT_EXTEND_DART_CLASS, |
+ JS_INTEROP_CLASS_NON_EXTERNAL_MEMBER, |
LIBRARY_NAME_MISMATCH, |
LIBRARY_NOT_FOUND, |
LIBRARY_NOT_SUPPORTED, |
@@ -2130,6 +2132,45 @@ main() => A.A = 1; |
const MessageTemplate(MessageKind.INTERNAL_LIBRARY, |
"Internal library '#{resolvedUri}' is not accessible."), |
+ MessageKind.JS_INTEROP_CLASS_CANNOT_EXTEND_DART_CLASS: |
+ const MessageTemplate( |
+ MessageKind.JS_INTEROP_CLASS_CANNOT_EXTEND_DART_CLASS, |
+ "Js-interop class '#{cls}' cannot extend from the non js-interop " |
+ "class '#{superclass}'.", |
+ howToFix: "Annotate the superclass with @Js.", |
+ examples: const [ |
+ """ |
+ import 'package:js/js.dart'; |
+ |
+ class Foo { } |
+ |
+ @Js() |
+ class Bar extends Foo { } |
+ |
+ main() { |
+ new Bar(); |
+ } |
+ """]), |
+ |
+ MessageKind.JS_INTEROP_CLASS_NON_EXTERNAL_MEMBER: |
+ const MessageTemplate( |
+ MessageKind.JS_INTEROP_CLASS_NON_EXTERNAL_MEMBER, |
+ "Member '#{member}' in js-interop class '#{cls}' is not external.", |
+ howToFix: "Mark all interop methods external", |
+ examples: const [ |
+ """ |
+ import 'package:js/js.dart'; |
+ |
+ @Js() |
+ class Foo { |
+ bar() {} |
+ } |
+ |
+ main() { |
+ new Foo().bar(); |
+ } |
+ """]), |
+ |
MessageKind.LIBRARY_NOT_FOUND: |
const MessageTemplate(MessageKind.LIBRARY_NOT_FOUND, |
"Library not found '#{resolvedUri}'."), |