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

Side by Side Diff: compiler/lib/implementation/string.js

Issue 8321024: Clean up (most) uses of Array. Still more to come in the VM corelib code base. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: '' Created 9 years, 2 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « compiler/lib/implementation/string.dart ('k') | compiler/lib/implementation/string_base.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 }
OLDNEW
« no previous file with comments | « compiler/lib/implementation/string.dart ('k') | compiler/lib/implementation/string_base.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698