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

Side by Side Diff: frog/lib/string_base.dart

Issue 10548047: Remove frog from the repository. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Move test and update apidoc.gyp. Created 8 years, 6 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 | « frog/lib/num.dart ('k') | frog/lib/string_buffer.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // BSD-style license that can be found in the LICENSE file.
4
5 class StringBase {
6 // TODO(jmesserly): this array copy is really unfortunate
7 // TODO(jmesserly): check the performance of String.fromCharCode.apply
8 // TODO(jmesserly): fix the generated JS name of factory ctors,
9 // they shouldn't be duplicating the name.
10 static String createFromCharCodes(List<int> charCodes) native @'''
11 if (Object.getPrototypeOf(charCodes) !== Array.prototype) {
12 charCodes = new ListFactory.ListFactory$from$factory(charCodes);
13 }
14 return String.fromCharCode.apply(null, charCodes);
15 ''' {
16 // we may need to iterate over charCodes
17 var i = charCodes.iterator(); i.next(); i.hasNext();
18 new ListFactory.from(charCodes); // ensure List.from is generated
19 }
20
21 static String join(List<String> strings, String separator) {
22 if (strings.length == 0) return '';
23 String s = strings[0];
24 for (int i = 1; i < strings.length; i++) {
25 s = s + separator + strings[i];
26 }
27 return s;
28 }
29
30 static String concatAll(List<String> strings) => join(strings, "");
31 }
OLDNEW
« no previous file with comments | « frog/lib/num.dart ('k') | frog/lib/string_buffer.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698