| OLD | NEW |
| 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 #include "platform/assert.h" | 5 #include "platform/assert.h" |
| 6 #include "vm/bootstrap_natives.h" | 6 #include "vm/bootstrap_natives.h" |
| 7 #include "vm/class_finalizer.h" | 7 #include "vm/class_finalizer.h" |
| 8 #include "vm/dart.h" | 8 #include "vm/dart.h" |
| 9 #include "vm/dart_api_impl.h" | 9 #include "vm/dart_api_impl.h" |
| 10 #include "vm/dart_entry.h" | 10 #include "vm/dart_entry.h" |
| (...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 179 "Unable to canonicalize uri '%s': no library tag handler found.", | 179 "Unable to canonicalize uri '%s': no library tag handler found.", |
| 180 uri.ToCString()); | 180 uri.ToCString()); |
| 181 return false; | 181 return false; |
| 182 } | 182 } |
| 183 Dart_Handle result = handler(kCanonicalizeUrl, | 183 Dart_Handle result = handler(kCanonicalizeUrl, |
| 184 Api::NewHandle(isolate, library.raw()), | 184 Api::NewHandle(isolate, library.raw()), |
| 185 Api::NewHandle(isolate, uri.raw())); | 185 Api::NewHandle(isolate, uri.raw())); |
| 186 const Object& obj = Object::Handle(Api::UnwrapHandle(result)); | 186 const Object& obj = Object::Handle(Api::UnwrapHandle(result)); |
| 187 if (obj.IsError()) { | 187 if (obj.IsError()) { |
| 188 Error& error_obj = Error::Handle(); | 188 Error& error_obj = Error::Handle(); |
| 189 error_obj |= obj.raw(); | 189 error_obj ^= obj.raw(); |
| 190 *error = zone->PrintToString("Unable to canonicalize uri '%s': %s", | 190 *error = zone->PrintToString("Unable to canonicalize uri '%s': %s", |
| 191 uri.ToCString(), error_obj.ToErrorCString()); | 191 uri.ToCString(), error_obj.ToErrorCString()); |
| 192 return false; | 192 return false; |
| 193 } else if (obj.IsString()) { | 193 } else if (obj.IsString()) { |
| 194 String& string_obj = String::Handle(); | 194 String& string_obj = String::Handle(); |
| 195 string_obj |= obj.raw(); | 195 string_obj |= obj.raw(); |
| 196 *canonical_uri = zone->MakeCopyOfString(string_obj.ToCString()); | 196 *canonical_uri = zone->MakeCopyOfString(string_obj.ToCString()); |
| 197 return true; | 197 return true; |
| 198 } else { | 198 } else { |
| 199 *error = zone->PrintToString("Unable to canonicalize uri '%s': " | 199 *error = zone->PrintToString("Unable to canonicalize uri '%s': " |
| (...skipping 291 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 491 | 491 |
| 492 DEFINE_NATIVE_ENTRY(isolate_getPortInternal, 0) { | 492 DEFINE_NATIVE_ENTRY(isolate_getPortInternal, 0) { |
| 493 const Object& port = Object::Handle(ReceivePortCreate(isolate->main_port())); | 493 const Object& port = Object::Handle(ReceivePortCreate(isolate->main_port())); |
| 494 if (port.IsError()) { | 494 if (port.IsError()) { |
| 495 Exceptions::PropagateError(Error::Cast(port)); | 495 Exceptions::PropagateError(Error::Cast(port)); |
| 496 } | 496 } |
| 497 return port.raw(); | 497 return port.raw(); |
| 498 } | 498 } |
| 499 | 499 |
| 500 } // namespace dart | 500 } // namespace dart |
| OLD | NEW |