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

Unified Diff: lib/src/info.dart

Issue 1184843002: fixes #192, encode dynamic info in checker (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: Created 5 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 | « lib/src/codegen/js_codegen.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/src/info.dart
diff --git a/lib/src/info.dart b/lib/src/info.dart
index e250135429a970cefbe5d8821a2136bcc37c5f37..4eb0235be94954a66273738022a6baa217cd6390 100644
--- a/lib/src/info.dart
+++ b/lib/src/info.dart
@@ -124,7 +124,7 @@ abstract class CoercionInfo extends StaticInfo {
String get description => '${this.runtimeType}: $baseType to $convertedType';
- static const String _propertyName = 'dev_compiler.Conversion';
+ static const String _propertyName = 'dev_compiler.src.info.CoercionInfo';
/// Gets the coercion info associated with this node.
static CoercionInfo get(AstNode node) => node.getProperty(_propertyName);
@@ -345,6 +345,22 @@ class DynamicInvoke extends CoercionInfo {
DartType get convertedType => rules.provider.dynamicType;
String get message => '$node requires dynamic invoke';
Level get level => Level.INFO;
+
+ static const String _propertyName = 'dev_compiler.src.info.DynamicInvoke';
+
+ /// Whether this [node] is the target of a dynamic operation.
+ static bool get(AstNode node) {
+ var value = node.getProperty(_propertyName);
+ return value != null ? value : false;
+ }
+
+ /// Sets whether this node is the target of a dynamic operation.
+ static bool set(AstNode node, bool value) {
+ // Free the storage for things that aren't dynamic.
+ if (value == false) value = null;
+ node.setProperty(_propertyName, value);
+ return value;
+ }
}
abstract class StaticError extends StaticInfo {
« no previous file with comments | « lib/src/codegen/js_codegen.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698