| 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 "bin/dartutils.h" | 5 #include "bin/dartutils.h" |
| 6 | 6 |
| 7 #include "include/dart_api.h" | 7 #include "include/dart_api.h" |
| 8 #include "include/dart_native_api.h" | 8 #include "include/dart_native_api.h" |
| 9 | 9 |
| 10 #include "platform/assert.h" | 10 #include "platform/assert.h" |
| (...skipping 362 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 373 // Handle URI canonicalization requests. | 373 // Handle URI canonicalization requests. |
| 374 if (tag == Dart_kCanonicalizeUrl) { | 374 if (tag == Dart_kCanonicalizeUrl) { |
| 375 // If this is a Dart Scheme URL or 'part' of a io library | 375 // If this is a Dart Scheme URL or 'part' of a io library |
| 376 // then it is not modified as it will be handled internally. | 376 // then it is not modified as it will be handled internally. |
| 377 if (is_dart_scheme_url || is_io_library) { | 377 if (is_dart_scheme_url || is_io_library) { |
| 378 return url; | 378 return url; |
| 379 } | 379 } |
| 380 // Resolve the url within the context of the library's URL. | 380 // Resolve the url within the context of the library's URL. |
| 381 Dart_Handle builtin_lib = | 381 Dart_Handle builtin_lib = |
| 382 Builtin::LoadAndCheckLibrary(Builtin::kBuiltinLibrary); | 382 Builtin::LoadAndCheckLibrary(Builtin::kBuiltinLibrary); |
| 383 Dart_Handle library_url = Dart_LibraryUrl(library); | |
| 384 if (Dart_IsError(library_url)) { | |
| 385 return library_url; | |
| 386 } | |
| 387 return ResolveUri(library_url, url, builtin_lib); | 383 return ResolveUri(library_url, url, builtin_lib); |
| 388 } | 384 } |
| 389 | 385 |
| 390 // Handle 'import' of dart scheme URIs (i.e they start with 'dart:'). | 386 // Handle 'import' of dart scheme URIs (i.e they start with 'dart:'). |
| 391 if (is_dart_scheme_url) { | 387 if (is_dart_scheme_url) { |
| 392 if (tag == Dart_kImportTag) { | 388 if (tag == Dart_kImportTag) { |
| 393 // Handle imports of other built-in libraries present in the SDK. | 389 // Handle imports of other built-in libraries present in the SDK. |
| 394 if (DartUtils::IsDartIOLibURL(url_string)) { | 390 if (DartUtils::IsDartIOLibURL(url_string)) { |
| 395 return Builtin::LoadLibrary(url, Builtin::kIOLibrary); | 391 return Builtin::LoadLibrary(url, Builtin::kIOLibrary); |
| 396 } | 392 } |
| (...skipping 578 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 975 new CObjectString(CObject::NewString(os_error->message())); | 971 new CObjectString(CObject::NewString(os_error->message())); |
| 976 CObjectArray* result = new CObjectArray(CObject::NewArray(3)); | 972 CObjectArray* result = new CObjectArray(CObject::NewArray(3)); |
| 977 result->SetAt(0, new CObjectInt32(CObject::NewInt32(kOSError))); | 973 result->SetAt(0, new CObjectInt32(CObject::NewInt32(kOSError))); |
| 978 result->SetAt(1, new CObjectInt32(CObject::NewInt32(os_error->code()))); | 974 result->SetAt(1, new CObjectInt32(CObject::NewInt32(os_error->code()))); |
| 979 result->SetAt(2, error_message); | 975 result->SetAt(2, error_message); |
| 980 return result; | 976 return result; |
| 981 } | 977 } |
| 982 | 978 |
| 983 } // namespace bin | 979 } // namespace bin |
| 984 } // namespace dart | 980 } // namespace dart |
| OLD | NEW |