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 function native_StringImplementation__indexOperator(index) { | 5 function native_StringImplementation__indexOperator(index) { |
6 return this[index]; | 6 return this[index]; |
7 } | 7 } |
8 | 8 |
9 function native_StringImplementation__charCodeAt(index) { | 9 function native_StringImplementation__charCodeAt(index) { |
10 return this.charCodeAt(index); | 10 return this.charCodeAt(index); |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
103 // TODO(floitsch): If we allow comparison operators on the String class we | 103 // TODO(floitsch): If we allow comparison operators on the String class we |
104 // should move this function into dart world. | 104 // should move this function into dart world. |
105 function native_StringImplementation_compareTo(other) { | 105 function native_StringImplementation_compareTo(other) { |
106 if (this == other) return 0; | 106 if (this == other) return 0; |
107 if (this < other) return -1; | 107 if (this < other) return -1; |
108 return 1; | 108 return 1; |
109 } | 109 } |
110 | 110 |
111 function native_StringImplementation__newFromValues(array) { | 111 function native_StringImplementation__newFromValues(array) { |
112 if (!(array instanceof Array)) { | 112 if (!(array instanceof Array)) { |
113 var length = native__ArrayJsUtil__arrayLength(array); | 113 var length = native__ListJsUtil__listLength(array); |
114 var tmp = new Array(length); | 114 var tmp = new Array(length); |
115 for (var i = 0; i < length; i++) { | 115 for (var i = 0; i < length; i++) { |
116 tmp[i] = INDEX$operator(array, i); | 116 tmp[i] = INDEX$operator(array, i); |
117 } | 117 } |
118 array = tmp; | 118 array = tmp; |
119 } | 119 } |
120 return String.fromCharCode.apply(this, array); | 120 return String.fromCharCode.apply(this, array); |
121 } | 121 } |
122 | 122 |
123 // Deprecated old name of new String.fromValues(..). | 123 // Deprecated old name of new String.fromValues(..). |
124 function native_StringBase_createFromCharCodes(array) { | 124 function native_StringBase_createFromCharCodes(array) { |
125 return native_StringImplementation__newFromValues(array); | 125 return native_StringImplementation__newFromValues(array); |
126 } | 126 } |
OLD | NEW |