| 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 #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 | 10 |
| (...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 133 GrowableArray<const Object*> args; | 133 GrowableArray<const Object*> args; |
| 134 Exceptions::ThrowByType(Exceptions::kIllegalArgument, args); | 134 Exceptions::ThrowByType(Exceptions::kIllegalArgument, args); |
| 135 } | 135 } |
| 136 String& b = String::Handle(); | 136 String& b = String::Handle(); |
| 137 b ^= b_instance.raw(); | 137 b ^= b_instance.raw(); |
| 138 const String& result = String::Handle(String::Concat(a, b)); | 138 const String& result = String::Handle(String::Concat(a, b)); |
| 139 arguments->SetReturn(result); | 139 arguments->SetReturn(result); |
| 140 } | 140 } |
| 141 | 141 |
| 142 | 142 |
| 143 DEFINE_NATIVE_ENTRY(String_toLowerCase, 1) { |
| 144 const String& str = String::CheckedHandle(arguments->At(0)); |
| 145 ASSERT(!str.IsNull()); |
| 146 const String& result = String::Handle(String::ToLowerCase(str)); |
| 147 arguments->SetReturn(result); |
| 148 } |
| 149 |
| 150 |
| 151 DEFINE_NATIVE_ENTRY(String_toUpperCase, 1) { |
| 152 const String& str = String::CheckedHandle(arguments->At(0)); |
| 153 ASSERT(!str.IsNull()); |
| 154 const String& result = String::Handle(String::ToUpperCase(str)); |
| 155 arguments->SetReturn(result); |
| 156 } |
| 157 |
| 158 |
| 143 DEFINE_NATIVE_ENTRY(Strings_concatAll, 1) { | 159 DEFINE_NATIVE_ENTRY(Strings_concatAll, 1) { |
| 144 const Array& strings = Array::CheckedHandle(arguments->At(0)); | 160 const Array& strings = Array::CheckedHandle(arguments->At(0)); |
| 145 ASSERT(!strings.IsNull()); | 161 ASSERT(!strings.IsNull()); |
| 146 const String& result = String::Handle(String::ConcatAll(strings)); | 162 const String& result = String::Handle(String::ConcatAll(strings)); |
| 147 arguments->SetReturn(result); | 163 arguments->SetReturn(result); |
| 148 } | 164 } |
| 149 | 165 |
| 150 } // namespace dart | 166 } // namespace dart |
| OLD | NEW |