| 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 490 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 501 return library_url; | 501 return library_url; |
| 502 } | 502 } |
| 503 return ResolveUri(library_url, url, builtin_lib); | 503 return ResolveUri(library_url, url, builtin_lib); |
| 504 } | 504 } |
| 505 | 505 |
| 506 // Handle 'import' of dart scheme URIs (i.e they start with 'dart:'). | 506 // Handle 'import' of dart scheme URIs (i.e they start with 'dart:'). |
| 507 if (is_dart_scheme_url) { | 507 if (is_dart_scheme_url) { |
| 508 if (tag == Dart_kImportTag) { | 508 if (tag == Dart_kImportTag) { |
| 509 // Handle imports of other built-in libraries present in the SDK. | 509 // Handle imports of other built-in libraries present in the SDK. |
| 510 if (DartUtils::IsDartIOLibURL(url_string)) { | 510 if (DartUtils::IsDartIOLibURL(url_string)) { |
| 511 return Builtin::LoadAndCheckLibrary(Builtin::kIOLibrary); | 511 return Builtin::LoadLibrary(url, Builtin::kIOLibrary); |
| 512 } | 512 } |
| 513 return NewError("The built-in library '%s' is not available" | 513 return NewError("The built-in library '%s' is not available" |
| 514 " on the stand-alone VM.\n", url_string); | 514 " on the stand-alone VM.\n", url_string); |
| 515 } else { | 515 } else { |
| 516 ASSERT(tag == Dart_kSourceTag); | 516 ASSERT(tag == Dart_kSourceTag); |
| 517 return NewError("Unable to load source '%s' ", url_string); | 517 return NewError("Unable to load source '%s' ", url_string); |
| 518 } | 518 } |
| 519 } | 519 } |
| 520 | 520 |
| 521 // Handle 'part' of IO library. | 521 // Handle 'part' of IO library. |
| (...skipping 596 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1118 new CObjectString(CObject::NewString(os_error->message())); | 1118 new CObjectString(CObject::NewString(os_error->message())); |
| 1119 CObjectArray* result = new CObjectArray(CObject::NewArray(3)); | 1119 CObjectArray* result = new CObjectArray(CObject::NewArray(3)); |
| 1120 result->SetAt(0, new CObjectInt32(CObject::NewInt32(kOSError))); | 1120 result->SetAt(0, new CObjectInt32(CObject::NewInt32(kOSError))); |
| 1121 result->SetAt(1, new CObjectInt32(CObject::NewInt32(os_error->code()))); | 1121 result->SetAt(1, new CObjectInt32(CObject::NewInt32(os_error->code()))); |
| 1122 result->SetAt(2, error_message); | 1122 result->SetAt(2, error_message); |
| 1123 return result; | 1123 return result; |
| 1124 } | 1124 } |
| 1125 | 1125 |
| 1126 } // namespace bin | 1126 } // namespace bin |
| 1127 } // namespace dart | 1127 } // namespace dart |
| OLD | NEW |