| OLD | NEW |
| 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 interface Visitor<R> { | 5 interface Visitor<R> { |
| 6 R visitBlock(Block node); | 6 R visitBlock(Block node); |
| 7 R visitBreakStatement(BreakStatement node); | 7 R visitBreakStatement(BreakStatement node); |
| 8 R visitCatchBlock(CatchBlock node); | 8 R visitCatchBlock(CatchBlock node); |
| 9 R visitClassNode(ClassNode node); | 9 R visitClassNode(ClassNode node); |
| 10 R visitConditional(Conditional node); | 10 R visitConditional(Conditional node); |
| (...skipping 707 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 718 | 718 |
| 719 class DartString implements Iterable<int> { | 719 class DartString implements Iterable<int> { |
| 720 factory DartString.literal(String string) => new LiteralDartString(string); | 720 factory DartString.literal(String string) => new LiteralDartString(string); |
| 721 factory DartString.rawString(SourceString source, int length) => | 721 factory DartString.rawString(SourceString source, int length) => |
| 722 new RawSourceDartString(source, length); | 722 new RawSourceDartString(source, length); |
| 723 factory DartString.escapedString(SourceString source, int length) => | 723 factory DartString.escapedString(SourceString source, int length) => |
| 724 new EscapedSourceDartString(source, length); | 724 new EscapedSourceDartString(source, length); |
| 725 DartString(); | 725 DartString(); |
| 726 abstract int get length(); | 726 abstract int get length(); |
| 727 bool isEmpty() => length == 0; | 727 bool isEmpty() => length == 0; |
| 728 // TODO(lrn): Is this test too expensive? |
| 729 bool definitelyEquals(DartString other) => toString() == other.toString(); |
| 728 abstract Iterator<int> iterator(); | 730 abstract Iterator<int> iterator(); |
| 729 abstract String toString(); | 731 abstract String toString(); |
| 730 | 732 |
| 731 bool operator ==(var other) { | 733 bool operator ==(var other) { |
| 732 if (other is !DartString) return false; | 734 if (other is !DartString) return false; |
| 733 DartString otherString = other; | 735 DartString otherString = other; |
| 734 if (length != otherString.length) return false; | 736 if (length != otherString.length) return false; |
| 735 Iterator it1 = iterator(); | 737 Iterator it1 = iterator(); |
| 736 Iterator it2 = otherString.iterator(); | 738 Iterator it2 = otherString.iterator(); |
| 737 while (it1.hasNext()) { | 739 while (it1.hasNext()) { |
| (...skipping 875 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1613 static bool isConstructorRedirect(Send node) { | 1615 static bool isConstructorRedirect(Send node) { |
| 1614 return (node.receiver === null && | 1616 return (node.receiver === null && |
| 1615 node.selector.asIdentifier() !== null && | 1617 node.selector.asIdentifier() !== null && |
| 1616 node.selector.asIdentifier().isThis()) || | 1618 node.selector.asIdentifier().isThis()) || |
| 1617 (node.receiver !== null && | 1619 (node.receiver !== null && |
| 1618 node.receiver.asIdentifier() !== null && | 1620 node.receiver.asIdentifier() !== null && |
| 1619 node.receiver.asIdentifier().isThis() && | 1621 node.receiver.asIdentifier().isThis() && |
| 1620 node.selector.asIdentifier() !== null); | 1622 node.selector.asIdentifier() !== null); |
| 1621 } | 1623 } |
| 1622 } | 1624 } |
| OLD | NEW |