Skip to content

Commit

Permalink
refactor(ngast,ngcompiler): reduce dynamic usage in i18n
Browse files Browse the repository at this point in the history
Signed-off-by: Gavin Zhao <[email protected]>
  • Loading branch information
GZGavinZhao committed Feb 4, 2024
1 parent 91c394d commit 74986e5
Show file tree
Hide file tree
Showing 23 changed files with 27 additions and 27 deletions.
2 changes: 1 addition & 1 deletion ngast/lib/src/ast/attribute.dart
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ abstract mixin class AttributeAst implements TemplateAst {
}

@override
bool operator ==(Object? other) {
bool operator ==(Object other) {
return other is AttributeAst &&
name == other.name &&
value == other.value &&
Expand Down
2 changes: 1 addition & 1 deletion ngast/lib/src/ast/close_element.dart
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ abstract mixin class CloseElementAst implements TemplateAst {
}) = ParsedCloseElementAst;

@override
bool operator ==(Object? other) {
bool operator ==(Object other) {
return other is CloseElementAst && name == other.name;
}

Expand Down
2 changes: 1 addition & 1 deletion ngast/lib/src/ast/comment.dart
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ abstract mixin class CommentAst implements StandaloneTemplateAst {
}

@override
bool operator ==(Object? other) {
bool operator ==(Object other) {
return other is CommentAst && value == other.value;
}

Expand Down
2 changes: 1 addition & 1 deletion ngast/lib/src/ast/container.dart
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ abstract mixin class ContainerAst implements StandaloneTemplateAst {
}

@override
bool operator ==(Object? other) {
bool operator ==(Object other) {
return other is ContainerAst &&
_listEquals.equals(childNodes, other.childNodes) &&
_listEquals.equals(stars, other.stars) &&
Expand Down
2 changes: 1 addition & 1 deletion ngast/lib/src/ast/content.dart
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ abstract mixin class EmbeddedContentAst implements StandaloneTemplateAst {
set closeComplement(CloseElementAst closeComplement);

@override
bool operator ==(Object? other) {
bool operator ==(Object other) {
return other is EmbeddedContentAst &&
other.selector == selector &&
other.ngProjectAs == ngProjectAs &&
Expand Down
2 changes: 1 addition & 1 deletion ngast/lib/src/ast/element.dart
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ abstract mixin class ElementAst implements StandaloneTemplateAst {
}) = ParsedElementAst;

@override
bool operator ==(Object? other) {
bool operator ==(Object other) {
return other is ElementAst &&
name == other.name &&
closeComplement == other.closeComplement &&
Expand Down
2 changes: 1 addition & 1 deletion ngast/lib/src/ast/event.dart
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ abstract mixin class EventAst implements TemplateAst {
]) = ParsedEventAst;

@override
bool operator ==(Object? other) {
bool operator ==(Object other) {
return other is EventAst &&
name == other.name &&
_listEquals.equals(reductions, other.reductions);
Expand Down
2 changes: 1 addition & 1 deletion ngast/lib/src/ast/interpolation.dart
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ abstract mixin class InterpolationAst implements StandaloneTemplateAst {
String get value;

@override
bool operator ==(Object? other) {
bool operator ==(Object other) {
return other is InterpolationAst && other.value == value;
}

Expand Down
2 changes: 1 addition & 1 deletion ngast/lib/src/ast/let_binding.dart
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ abstract mixin class LetBindingAst implements TemplateAst {
]) = ParsedLetBindingAst;

@override
bool operator ==(Object? other) {
bool operator ==(Object other) {
return other is LetBindingAst && name == other.name && value == other.value;
}

Expand Down
2 changes: 1 addition & 1 deletion ngast/lib/src/ast/property.dart
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ abstract mixin class PropertyAst implements TemplateAst {
]) = ParsedPropertyAst;

@override
bool operator ==(Object? other) {
bool operator ==(Object other) {
return other is PropertyAst &&
name == other.name &&
postfix == other.postfix &&
Expand Down
2 changes: 1 addition & 1 deletion ngast/lib/src/ast/reference.dart
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ abstract mixin class ReferenceAst implements TemplateAst {
]) = ParsedReferenceAst;

@override
bool operator ==(Object? other) {
bool operator ==(Object other) {
return other is ReferenceAst &&
identifier == other.identifier &&
variable == other.variable;
Expand Down
2 changes: 1 addition & 1 deletion ngast/lib/src/ast/sugar/annotation.dart
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ abstract mixin class AnnotationAst implements TemplateAst {
}

@override
bool operator ==(Object? other) {
bool operator ==(Object other) {
return other is AnnotationAst && name == other.name && value == other.value;
}

Expand Down
2 changes: 1 addition & 1 deletion ngast/lib/src/ast/sugar/banana.dart
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ abstract mixin class BananaAst implements TemplateAst {
}

@override
bool operator ==(Object? other) {
bool operator ==(Object other) {
return other is BananaAst && name == other.name && value == other.value;
}

Expand Down
2 changes: 1 addition & 1 deletion ngast/lib/src/ast/sugar/star.dart
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ abstract mixin class StarAst implements TemplateAst {
}

@override
bool operator ==(Object? other) {
bool operator ==(Object other) {
return other is PropertyAst && value == other.value && name == other.name;
}

Expand Down
2 changes: 1 addition & 1 deletion ngast/lib/src/ast/template.dart
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ abstract mixin class EmbeddedTemplateAst implements StandaloneTemplateAst {
set closeComplement(CloseElementAst? closeComplement);

@override
bool operator ==(Object? other) {
bool operator ==(Object other) {
return other is EmbeddedTemplateAst &&
closeComplement == other.closeComplement &&
_listEquals.equals(annotations, other.annotations) &&
Expand Down
2 changes: 1 addition & 1 deletion ngast/lib/src/ast/text.dart
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ abstract mixin class TextAst implements StandaloneTemplateAst {
) = _ParsedTextAst;

@override
bool operator ==(Object? other) {
bool operator ==(Object other) {
return other is TextAst && value == other.value;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class AngularParserException extends Error {
);

@override
bool operator ==(Object? other) {
bool operator ==(Object other) {
return other is AngularParserException &&
errorCode == other.errorCode &&
length == other.length &&
Expand Down
2 changes: 1 addition & 1 deletion ngast/lib/src/expression/micro/ast.dart
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class NgMicroAst {
});

@override
bool operator ==(Object? other) {
bool operator ==(Object other) {
return other is NgMicroAst &&
_listEquals.equals(letBindings, other.letBindings) &&
_listEquals.equals(properties, other.properties);
Expand Down
2 changes: 1 addition & 1 deletion ngast/lib/src/expression/micro/token.dart
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ class NgMicroToken {
const NgMicroToken._(this.type, this.lexeme, this.offset);

@override
bool operator ==(Object? other) {
bool operator ==(Object other) {
return other is NgMicroToken &&
other.offset == offset &&
other.type == type;
Expand Down
4 changes: 2 additions & 2 deletions ngast/lib/src/token/lexeme.dart
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class _LexemeNgSimpleToken extends NgSimpleToken {
: super._(type, offset);

@override
bool operator ==(Object? other) {
bool operator ==(Object other) {
return other is _LexemeNgSimpleToken &&
super == other &&
lexeme == other.lexeme;
Expand Down Expand Up @@ -41,7 +41,7 @@ class _LexemeNgToken extends NgToken {
);

@override
bool operator ==(Object? other) {
bool operator ==(Object other) {
return other is _LexemeNgToken && super == other && lexeme == other.lexeme;
}

Expand Down
8 changes: 4 additions & 4 deletions ngast/lib/src/token/tokens.dart
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ class NgSimpleToken implements NgBaseToken<NgSimpleTokenType> {
);

@override
bool operator ==(Object? other) {
bool operator ==(Object other) {
return other is NgSimpleToken &&
other.offset == offset &&
other.type == type;
Expand Down Expand Up @@ -224,7 +224,7 @@ class NgSimpleQuoteToken extends _LexemeNgSimpleToken {
);

@override
bool operator ==(Object? other) {
bool operator ==(Object other) {
return other is NgSimpleQuoteToken &&
other.offset == offset &&
other.type == type &&
Expand Down Expand Up @@ -405,7 +405,7 @@ class NgToken implements NgBaseToken<NgTokenType> {
});

@override
bool operator ==(Object? other) {
bool operator ==(Object other) {
return other is NgToken &&
(errorSynthetic || other.errorSynthetic
? other.offset == offset && other.type == type
Expand Down Expand Up @@ -478,7 +478,7 @@ class NgAttributeValueToken extends NgToken {
);

@override
bool operator ==(Object? other) {
bool operator ==(Object other) {
return other is NgAttributeValueToken &&
leftQuote == other.leftQuote &&
rightQuote == other.rightQuote &&
Expand Down
2 changes: 1 addition & 1 deletion ngcompiler/lib/v1/src/compiler/i18n/message.dart
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class I18nMessage {
int get hashCode => metadata.hashCode ^ text.hashCode ^ _map.hash(args);

@override
bool operator ==(dynamic other) =>
bool operator ==(Object other) =>
other is I18nMessage &&
other.metadata == metadata &&
other.text == text &&
Expand Down
2 changes: 1 addition & 1 deletion ngcompiler/lib/v1/src/compiler/i18n/metadata.dart
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ class I18nMetadata {
description.hashCode ^ locale.hashCode ^ meaning.hashCode ^ skip.hashCode;

@override
bool operator ==(dynamic other) =>
bool operator ==(Object other) =>
other is I18nMetadata &&
other.description == description &&
other.locale == locale &&
Expand Down

0 comments on commit 74986e5

Please sign in to comment.