| 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 467 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 478 return ResolveUri(library_url, url, builtin_lib); | 478 return ResolveUri(library_url, url, builtin_lib); |
| 479 } | 479 } |
| 480 | 480 |
| 481 // Handle 'import' of dart scheme URIs (i.e they start with 'dart:'). | 481 // Handle 'import' of dart scheme URIs (i.e they start with 'dart:'). |
| 482 if (is_dart_scheme_url) { | 482 if (is_dart_scheme_url) { |
| 483 if (tag == Dart_kImportTag) { | 483 if (tag == Dart_kImportTag) { |
| 484 // Handle imports of other built-in libraries present in the SDK. | 484 // Handle imports of other built-in libraries present in the SDK. |
| 485 if (DartUtils::IsDartIOLibURL(url_string)) { | 485 if (DartUtils::IsDartIOLibURL(url_string)) { |
| 486 return Builtin::LoadAndCheckLibrary(Builtin::kIOLibrary); | 486 return Builtin::LoadAndCheckLibrary(Builtin::kIOLibrary); |
| 487 } | 487 } |
| 488 return Dart_Error("Do not know how to load '%s'", url_string); | 488 return Dart_Error("The built-in library '%s' is not available" |
| 489 " on the stand-alone VM.\n", url_string); |
| 489 } else { | 490 } else { |
| 490 ASSERT(tag == Dart_kSourceTag); | 491 ASSERT(tag == Dart_kSourceTag); |
| 491 return Dart_Error("Unable to load source '%s' ", url_string); | 492 return Dart_Error("Unable to load source '%s' ", url_string); |
| 492 } | 493 } |
| 493 } | 494 } |
| 494 | 495 |
| 495 // Handle 'part' of IO library. | 496 // Handle 'part' of IO library. |
| 496 if (is_io_library) { | 497 if (is_io_library) { |
| 497 if (tag == Dart_kSourceTag) { | 498 if (tag == Dart_kSourceTag) { |
| 498 return Dart_LoadSource( | 499 return Dart_LoadSource( |
| (...skipping 524 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1023 new CObjectString(CObject::NewString(os_error->message())); | 1024 new CObjectString(CObject::NewString(os_error->message())); |
| 1024 CObjectArray* result = new CObjectArray(CObject::NewArray(3)); | 1025 CObjectArray* result = new CObjectArray(CObject::NewArray(3)); |
| 1025 result->SetAt(0, new CObjectInt32(CObject::NewInt32(kOSError))); | 1026 result->SetAt(0, new CObjectInt32(CObject::NewInt32(kOSError))); |
| 1026 result->SetAt(1, new CObjectInt32(CObject::NewInt32(os_error->code()))); | 1027 result->SetAt(1, new CObjectInt32(CObject::NewInt32(os_error->code()))); |
| 1027 result->SetAt(2, error_message); | 1028 result->SetAt(2, error_message); |
| 1028 return result; | 1029 return result; |
| 1029 } | 1030 } |
| 1030 | 1031 |
| 1031 } // namespace bin | 1032 } // namespace bin |
| 1032 } // namespace dart | 1033 } // namespace dart |
| OLD | NEW |