| Index: sdk/lib/_internal/compiler/implementation/compile_time_constants.dart
|
| diff --git a/sdk/lib/_internal/compiler/implementation/compile_time_constants.dart b/sdk/lib/_internal/compiler/implementation/compile_time_constants.dart
|
| index e717c15d48684de33dc8b8c17e651c1046ac53b9..776e1a9b22e51dd7c30555b619acf9ee2a931892 100644
|
| --- a/sdk/lib/_internal/compiler/implementation/compile_time_constants.dart
|
| +++ b/sdk/lib/_internal/compiler/implementation/compile_time_constants.dart
|
| @@ -409,6 +409,13 @@ class CompileTimeConstantEvaluator extends Visitor {
|
| assert(elements.isTypeLiteral(send));
|
| return makeTypeConstant(elements.getTypeLiteralType(send));
|
| } else if (send.receiver != null) {
|
| + if (send.selector.asIdentifier().source == "length") {
|
| + Constant left = evaluate(send.receiver);
|
| + if (left != null && left.isString) {
|
| + StringConstant string = left;
|
| + return constantSystem.createInt(string.value.length);
|
| + }
|
| + }
|
| // Fall through to error handling.
|
| } else if (!Elements.isUnresolved(element)
|
| && element.isVariable
|
| @@ -418,7 +425,7 @@ class CompileTimeConstantEvaluator extends Visitor {
|
| }
|
| return signalNotCompileTimeConstant(send);
|
| } else if (send.isCall) {
|
| - if (identical(element, compiler.identicalFunction)
|
| + if (element == compiler.identicalFunction
|
| && send.argumentCount() == 2) {
|
| Constant left = evaluate(send.argumentsNode.nodes.head);
|
| Constant right = evaluate(send.argumentsNode.nodes.tail.head);
|
|
|