Index: sdk/lib/_internal/compiler/implementation/lib/js_string.dart |
=================================================================== |
--- sdk/lib/_internal/compiler/implementation/lib/js_string.dart (revision 15078) |
+++ sdk/lib/_internal/compiler/implementation/lib/js_string.dart (working copy) |
@@ -123,5 +123,11 @@ |
return stringContainsUnchecked(this, other, startIndex); |
} |
- bool get isEmpty => length == 0; |
+ bool get isEmpty => length == 0; |
+ |
+ int compareTo(String other) { |
+ if (other is !String) throw new ArgumentError(other); |
+ return this == other ? 0 |
+ : JS('bool', r'# < #', this, other) ? -1 : 1; |
+ } |
} |