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

Unified Diff: pkg/analyzer/lib/src/task/strong/ast_properties.dart

Issue 2933753002: Run the sorter to reduce code churn (Closed)
Patch Set: Created 3 years, 6 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/analyzer/lib/src/task/driver.dart ('k') | pkg/analyzer/lib/src/task/strong/checker.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/lib/src/task/strong/ast_properties.dart
diff --git a/pkg/analyzer/lib/src/task/strong/ast_properties.dart b/pkg/analyzer/lib/src/task/strong/ast_properties.dart
index 0f93adafca085809e4b0c8e0414bb1eabc547188..621b79af6c306eb6bc55281ebb120073a51a6276 100644
--- a/pkg/analyzer/lib/src/task/strong/ast_properties.dart
+++ b/pkg/analyzer/lib/src/task/strong/ast_properties.dart
@@ -6,25 +6,18 @@
///
/// These properties are not public, but provided by use of back-ends such as
/// Dart Dev Compiler.
-
import 'package:analyzer/analyzer.dart';
import 'package:analyzer/dart/element/type.dart';
+const String _hasImplicitCasts = '_hasImplicitCasts';
const String _implicitAssignmentCast = '_implicitAssignmentCast';
const String _implicitCast = '_implicitCast';
-const String _hasImplicitCasts = '_hasImplicitCasts';
const String _isDynamicInvoke = '_isDynamicInvoke';
-/// True if this compilation unit has any implicit casts, otherwise false.
-///
-/// See also [getImplicitCast].
-bool hasImplicitCasts(CompilationUnit node) {
- return node.getProperty/*<bool>*/(_hasImplicitCasts) ?? false;
-}
-
-/// Sets [hasImplicitCasts] property for this compilation unit.
-void setHasImplicitCasts(CompilationUnit node, bool value) {
- node.setProperty(_hasImplicitCasts, value == true ? true : null);
+/// If this op-assign has an implicit cast on the assignment, returns the type
+/// it is coerced to, otherwise returns null.
+DartType getImplicitAssignmentCast(Expression node) {
+ return node.getProperty/*<DartType>*/(_implicitAssignmentCast);
}
/// If this expression has an implicit cast, returns the type it is coerced to,
@@ -33,15 +26,22 @@ DartType getImplicitCast(Expression node) {
return node.getProperty/*<DartType>*/(_implicitCast);
}
-/// Sets the result of [getImplicitCast] for this node.
-void setImplicitCast(Expression node, DartType type) {
- node.setProperty(_implicitCast, type);
+/// True if this compilation unit has any implicit casts, otherwise false.
+///
+/// See also [getImplicitCast].
+bool hasImplicitCasts(CompilationUnit node) {
+ return node.getProperty/*<bool>*/(_hasImplicitCasts) ?? false;
}
-/// If this op-assign has an implicit cast on the assignment, returns the type
-/// it is coerced to, otherwise returns null.
-DartType getImplicitAssignmentCast(Expression node) {
- return node.getProperty/*<DartType>*/(_implicitAssignmentCast);
+/// True if this node is a dynamic operation that requires dispatch and/or
+/// checking at runtime.
+bool isDynamicInvoke(Expression node) {
+ return node.getProperty/*<bool>*/(_isDynamicInvoke) ?? false;
+}
+
+/// Sets [hasImplicitCasts] property for this compilation unit.
+void setHasImplicitCasts(CompilationUnit node, bool value) {
+ node.setProperty(_hasImplicitCasts, value == true ? true : null);
}
/// Sets the result of [getImplicitAssignmentCast] for this node.
@@ -49,10 +49,9 @@ void setImplicitAssignmentCast(Expression node, DartType type) {
node.setProperty(_implicitAssignmentCast, type);
}
-/// True if this node is a dynamic operation that requires dispatch and/or
-/// checking at runtime.
-bool isDynamicInvoke(Expression node) {
- return node.getProperty/*<bool>*/(_isDynamicInvoke) ?? false;
+/// Sets the result of [getImplicitCast] for this node.
+void setImplicitCast(Expression node, DartType type) {
+ node.setProperty(_implicitCast, type);
}
/// Sets [isDynamicInvoke] property for this expression
« no previous file with comments | « pkg/analyzer/lib/src/task/driver.dart ('k') | pkg/analyzer/lib/src/task/strong/checker.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698