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

Side by Side Diff: runtime/lib/string.cc

Issue 12282038: Remove deprecated string features. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Merge to head Created 7 years, 10 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 | « runtime/lib/mirrors_impl.dart ('k') | runtime/lib/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 #include "vm/bootstrap_natives.h" 5 #include "vm/bootstrap_natives.h"
6 6
7 #include "vm/exceptions.h" 7 #include "vm/exceptions.h"
8 #include "vm/native_entry.h" 8 #include "vm/native_entry.h"
9 #include "vm/object.h" 9 #include "vm/object.h"
10 #include "vm/symbols.h" 10 #include "vm/symbols.h"
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
142 142
143 143
144 DEFINE_NATIVE_ENTRY(String_charAt, 2) { 144 DEFINE_NATIVE_ENTRY(String_charAt, 2) {
145 const String& receiver = String::CheckedHandle(arguments->NativeArgAt(0)); 145 const String& receiver = String::CheckedHandle(arguments->NativeArgAt(0));
146 GET_NON_NULL_NATIVE_ARGUMENT(Integer, index, arguments->NativeArgAt(1)); 146 GET_NON_NULL_NATIVE_ARGUMENT(Integer, index, arguments->NativeArgAt(1));
147 uint32_t value = StringValueAt(receiver, index); 147 uint32_t value = StringValueAt(receiver, index);
148 ASSERT(value <= 0x10FFFF); 148 ASSERT(value <= 0x10FFFF);
149 return Symbols::FromCharCode(value); 149 return Symbols::FromCharCode(value);
150 } 150 }
151 151
152 DEFINE_NATIVE_ENTRY(String_charCodeAt, 2) { 152 DEFINE_NATIVE_ENTRY(String_codeUnitAt, 2) {
153 const String& receiver = String::CheckedHandle(arguments->NativeArgAt(0)); 153 const String& receiver = String::CheckedHandle(arguments->NativeArgAt(0));
154 GET_NON_NULL_NATIVE_ARGUMENT(Integer, index, arguments->NativeArgAt(1)); 154 GET_NON_NULL_NATIVE_ARGUMENT(Integer, index, arguments->NativeArgAt(1));
155 155
156 int32_t value = StringValueAt(receiver, index); 156 int32_t value = StringValueAt(receiver, index);
157 ASSERT(value >= 0); 157 ASSERT(value >= 0);
158 ASSERT(value <= 0x10FFFF); 158 ASSERT(value <= 0xFFFF);
159 return Smi::New(value); 159 return Smi::New(value);
160 } 160 }
161 161
162 162
163 DEFINE_NATIVE_ENTRY(String_concat, 2) { 163 DEFINE_NATIVE_ENTRY(String_concat, 2) {
164 const String& receiver = String::CheckedHandle(arguments->NativeArgAt(0)); 164 const String& receiver = String::CheckedHandle(arguments->NativeArgAt(0));
165 GET_NON_NULL_NATIVE_ARGUMENT(String, b, arguments->NativeArgAt(1)); 165 GET_NON_NULL_NATIVE_ARGUMENT(String, b, arguments->NativeArgAt(1));
166 return String::Concat(receiver, b); 166 return String::Concat(receiver, b);
167 } 167 }
168 168
(...skipping 22 matching lines...) Expand all
191 if (!elem.IsString()) { 191 if (!elem.IsString()) {
192 const Array& args = Array::Handle(Array::New(1)); 192 const Array& args = Array::Handle(Array::New(1));
193 args.SetAt(0, elem); 193 args.SetAt(0, elem);
194 Exceptions::ThrowByType(Exceptions::kArgument, args); 194 Exceptions::ThrowByType(Exceptions::kArgument, args);
195 } 195 }
196 } 196 }
197 return String::ConcatAll(strings); 197 return String::ConcatAll(strings);
198 } 198 }
199 199
200 } // namespace dart 200 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/lib/mirrors_impl.dart ('k') | runtime/lib/string_base.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698