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

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 99aa824372b3e97eedd8a899eb49cf0fba56393f..b4ab696afa17380c2c4fdf565f36f0b7f9ee6a76 100644
--- a/pkg/compiler/lib/src/diagnostics/messages.dart
+++ b/pkg/compiler/lib/src/diagnostics/messages.dart
@@ -270,6 +270,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_TAG_MUST_BE_FIRST,
@@ -2083,6 +2085,33 @@ 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,
+ "#{cls} cannot extend a normal Dart class as it is annoted with"
+ "@Js.",
+ howToFix: "Add @Js annotation to super class",
+ examples: const [
+ """
+ class Foo { }
+
+ @Js()
+ class Bar extends Foo { }
+ """]),
+
+ MessageKind.JS_INTEROP_CLASS_NON_EXTERNAL_MEMBER:
+ const MessageTemplate(
+ MessageKind.JS_INTEROP_CLASS_NON_EXTERNAL_MEMBER,
+ "Js interop class #{cls} member #{member} is not external.",
+ howToFix: "Mark all interop methods external",
+ examples: const [
+ """
+ @Js
+ class Foo {
+ external bar();
+ }
+ """]),
+
MessageKind.LIBRARY_NOT_FOUND:
const MessageTemplate(MessageKind.LIBRARY_NOT_FOUND,
"Library not found '#{resolvedUri}'."),

Powered by Google App Engine
This is Rietveld 408576698