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

Side by Side Diff: sdk/lib/_internal/compiler/implementation/lib/string_helper.dart

Issue 11413184: Create specialized versions of getInterceptor. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years 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
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 class StringMatch implements Match { 5 class StringMatch implements Match {
6 const StringMatch(int this.start, 6 const StringMatch(int this.start,
7 String this.str, 7 String this.str,
8 String this.pattern); 8 String this.pattern);
9 9
10 int get end => start + pattern.length; 10 int get end => start + pattern.length;
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
115 } else if (from is JSSyntaxRegExp) { 115 } else if (from is JSSyntaxRegExp) {
116 var re = regExpGetNative(from); 116 var re = regExpGetNative(from);
117 return stringReplaceJS(receiver, re, to); 117 return stringReplaceJS(receiver, re, to);
118 } else { 118 } else {
119 checkNull(from); 119 checkNull(from);
120 // TODO(floitsch): implement generic String.replace (with patterns). 120 // TODO(floitsch): implement generic String.replace (with patterns).
121 throw "String.replace(Pattern) UNIMPLEMENTED"; 121 throw "String.replace(Pattern) UNIMPLEMENTED";
122 } 122 }
123 } 123 }
124 124
125 stringSplitUnchecked(receiver, pattern) {
126 if (pattern is String) {
127 return JS('=List', r'#.split(#)', receiver, pattern);
128 } else if (pattern is JSSyntaxRegExp) {
129 var re = regExpGetNative(pattern);
130 return JS('=List', r'#.split(#)', receiver, re);
131 } else {
132 throw "String.split(Pattern) UNIMPLEMENTED";
133 }
134 }
135
136 stringJoinUnchecked(array, separator) { 125 stringJoinUnchecked(array, separator) {
137 return JS('String', r'#.join(#)', array, separator); 126 return JS('String', r'#.join(#)', array, separator);
138 } 127 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698