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

Unified Diff: editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/internal/constant/ValidResult.java

Issue 581773002: Implement new constant expressions (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address review comments Created 6 years, 3 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
Index: editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/internal/constant/ValidResult.java
diff --git a/editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/internal/constant/ValidResult.java b/editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/internal/constant/ValidResult.java
index c7a0fd3863dac589a57f1bd8a5c0362652597bc3..37f6fc06daa8e14ad68e555b6d723518284252e4 100644
--- a/editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/internal/constant/ValidResult.java
+++ b/editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/internal/constant/ValidResult.java
@@ -273,6 +273,15 @@ public class ValidResult extends EvaluationResultImpl {
}
@Override
+ public EvaluationResultImpl stringLength(TypeProvider typeProvider, Expression node) {
+ try {
+ return valueOf(value.stringLength(typeProvider));
+ } catch (EvaluationException exception) {
+ return error(node, exception.getErrorCode());
+ }
+ }
+
+ @Override
public EvaluationResultImpl times(TypeProvider typeProvider, BinaryExpression node,
EvaluationResultImpl rightOperand) {
return rightOperand.timesValid(typeProvider, node, this);

Powered by Google App Engine
This is Rietveld 408576698