Skip to content

Commit

Permalink
[dart2js] More shared_messages.dart cleanup
Browse files Browse the repository at this point in the history
- Remove references to deleted file.
- Remove message that is unreachable in kernel.

Change-Id: I5fe772a3a6fbd00b31d085f10c47d63778a64217
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/214071
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
  • Loading branch information
rakudrama authored and commit-bot@chromium.org committed Sep 22, 2021
1 parent 1c125b4 commit f1e6092
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 46 deletions.
3 changes: 1 addition & 2 deletions WATCHLISTS
Expand Up @@ -53,8 +53,7 @@
'pkg/analyzer/lib/src/dart/error/hint_codes\\.dart|'
'pkg/analyzer/lib/src/dart/error/lint_codes\\.dart|'
'pkg/analyzer/lib/src/dart/error/todo_codes\\.dart|'
'pkg/analyzer/lib/src/html/error/html_codes\\.dart|'
'pkg/dart_messages/lib/shared_messages\\.dart'
'pkg/analyzer/lib/src/html/error/html_codes\\.dart'
')$'
)
},
Expand Down
2 changes: 0 additions & 2 deletions pkg/compiler/README.md
Expand Up @@ -631,8 +631,6 @@ _TODO: complete the documentation for the following files_.

`lib/src/diagnostics`
`lib/src/diagnostics/invariant.dart`
`lib/src/diagnostics/generated`
`lib/src/diagnostics/generated/shared_messages.dart`
`lib/src/diagnostics/messages.dart`
`lib/src/diagnostics/source_span.dart`
`lib/src/diagnostics/code_location.dart`
Expand Down
16 changes: 0 additions & 16 deletions pkg/compiler/lib/src/diagnostics/messages.dart
Expand Up @@ -23,7 +23,6 @@ const DONT_KNOW_HOW_TO_FIX = "Computer says no!";

/// Keys for the [MessageTemplate]s.
enum MessageKind {
ABSTRACT_GETTER,
COMPILER_CRASHED,
COMPLEX_RETURNING_NSM,
COMPLEX_THROWING_NSM,
Expand Down Expand Up @@ -114,21 +113,6 @@ class MessageTemplate {
MessageKind.WRONG_ARGUMENT_FOR_JS_INTERCEPTOR_CONSTANT,
"Argument for 'JS_INTERCEPTOR_CONSTANT' must be a type constant."),

MessageKind.ABSTRACT_GETTER: MessageTemplate(
MessageKind.ABSTRACT_GETTER,
"The getter '#{name}' has no implementation in "
"class '#{class}'.",
howToFix: "Try adding a body to '#{name}' or declaring "
"'#{class}' to be 'abstract'.",
examples: [
"""
class Class {
get getter;
}
main() => new Class();
"""
]),

MessageKind.INVALID_METADATA: MessageTemplate(
MessageKind.INVALID_METADATA,
"A metadata annotation must be either a reference to a compile-time "
Expand Down
28 changes: 3 additions & 25 deletions pkg/compiler/test/jsinterop/declaration_test.dart
Expand Up @@ -94,23 +94,6 @@ class A {
main() => new A();
'''),
const Test(
'Js-interop class with abstract getter.',
'''
@JS()
library test;
import 'package:js/js.dart';
@JS()
class A {
get foo;
}
main() => new A();
''',
warnings: const [MessageKind.ABSTRACT_GETTER],
skipForKernel: true),
const Test('Js-interop class that extends a js-interop class.', '''
@JS()
library test;
Expand Down Expand Up @@ -392,18 +375,15 @@ class Test {
final Map<String, String> _sources;
final List<MessageKind> errors;
final List<MessageKind> warnings;
final bool skipForKernel;

const Test(this.name, this._source,
{this.errors: const <MessageKind>[],
this.warnings: const <MessageKind>[],
this.skipForKernel: false})
this.warnings: const <MessageKind>[]})
: _sources = null;

const Test.multi(this.name, this._sources,
{this.errors: const <MessageKind>[],
this.warnings: const <MessageKind>[],
this.skipForKernel: false})
this.warnings: const <MessageKind>[]})
: _source = null;

String get source => _source != null ? _source : _sources['main.dart'];
Expand All @@ -415,9 +395,7 @@ class Test {
runTest(Test test) async {
print('==${test.name}======================================================');
print(test.source);
if (!test.skipForKernel) {
await runTestInternal(test);
}
await runTestInternal(test);
}

runTestInternal(Test test) async {
Expand Down
1 change: 0 additions & 1 deletion pkg/front_end/lib/src/fasta/diagnostics.md
Expand Up @@ -8,7 +8,6 @@
-- Note: if you move this file to a different location, please make sure that
-- you also update these references to it:
-- * pkg/compiler/lib/src/diagnostics/messages.dart
-- * pkg/dart_messages/lib/shared_messages.dart
-- * pkg/_fe_analyzer_shared/lib/src/base/errors.dart
-- * https://github.com/dart-lang/linter/
-->
Expand Down

0 comments on commit f1e6092

Please sign in to comment.