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

Unified Diff: pkg/compiler/lib/src/diagnostics/messages.dart

Issue 1318043005: Support user generated custom native JS classes. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: ptal 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/diagnostics/messages.dart
diff --git a/pkg/compiler/lib/src/diagnostics/messages.dart b/pkg/compiler/lib/src/diagnostics/messages.dart
index 347b25b54cd2b88e1154884f07d4e5ae2191dc7d..d5525f995651f7b4faafea3696985721baf49cad 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}.",
Siggi Cherem (dart-lang) 2015/10/13 02:08:53 nit: add missing ' ' around #{superclass}
Jacob 2015/10/13 03:10:42 Done.
+ 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}'."),

Powered by Google App Engine
This is Rietveld 408576698