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

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: about to land 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
« no previous file with comments | « pkg/compiler/lib/src/cps_ir/type_propagation.dart ('k') | pkg/compiler/lib/src/elements/elements.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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}'."),
« no previous file with comments | « pkg/compiler/lib/src/cps_ir/type_propagation.dart ('k') | pkg/compiler/lib/src/elements/elements.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698