| 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 576 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 587 Dart_Handle res = Dart_FinalizeLoading(true); | 587 Dart_Handle res = Dart_FinalizeLoading(true); |
| 588 if (Dart_IsError(res)) { | 588 if (Dart_IsError(res)) { |
| 589 // TODO(hausner): If compilation/loading errors are supposed to | 589 // TODO(hausner): If compilation/loading errors are supposed to |
| 590 // be observable by the program, we need to mark the bad library | 590 // be observable by the program, we need to mark the bad library |
| 591 // with the error instead of propagating it. | 591 // with the error instead of propagating it. |
| 592 Dart_PropagateError(res); | 592 Dart_PropagateError(res); |
| 593 } | 593 } |
| 594 } | 594 } |
| 595 | 595 |
| 596 | 596 |
| 597 Dart_Handle DartUtils::LoadSourceAsync(Dart_Handle library, | |
| 598 Dart_Handle url, | |
| 599 Dart_LibraryTag tag, | |
| 600 Dart_Handle builtin_lib) { | |
| 601 return LoadDataAsync_Invoke(Dart_NewInteger(tag), url, library, builtin_lib); | |
| 602 } | |
| 603 | |
| 604 | |
| 605 Dart_Handle DartUtils::PrepareForScriptLoading(const char* package_root, | 597 Dart_Handle DartUtils::PrepareForScriptLoading(const char* package_root, |
| 606 Dart_Handle builtin_lib) { | 598 Dart_Handle builtin_lib) { |
| 607 // First ensure all required libraries are available. | 599 // First ensure all required libraries are available. |
| 608 Dart_Handle url = NewString(kAsyncLibURL); | 600 Dart_Handle url = NewString(kAsyncLibURL); |
| 609 DART_CHECK_VALID(url); | 601 DART_CHECK_VALID(url); |
| 610 Dart_Handle async_lib = Dart_LookupLibrary(url); | 602 Dart_Handle async_lib = Dart_LookupLibrary(url); |
| 611 DART_CHECK_VALID(async_lib); | 603 DART_CHECK_VALID(async_lib); |
| 612 Dart_Handle io_lib = Builtin::LoadAndCheckLibrary(Builtin::kIOLibrary); | 604 Dart_Handle io_lib = Builtin::LoadAndCheckLibrary(Builtin::kIOLibrary); |
| 613 | 605 |
| 614 // We need to ensure that all the scripts loaded so far are finalized | 606 // We need to ensure that all the scripts loaded so far are finalized |
| (...skipping 368 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 983 new CObjectString(CObject::NewString(os_error->message())); | 975 new CObjectString(CObject::NewString(os_error->message())); |
| 984 CObjectArray* result = new CObjectArray(CObject::NewArray(3)); | 976 CObjectArray* result = new CObjectArray(CObject::NewArray(3)); |
| 985 result->SetAt(0, new CObjectInt32(CObject::NewInt32(kOSError))); | 977 result->SetAt(0, new CObjectInt32(CObject::NewInt32(kOSError))); |
| 986 result->SetAt(1, new CObjectInt32(CObject::NewInt32(os_error->code()))); | 978 result->SetAt(1, new CObjectInt32(CObject::NewInt32(os_error->code()))); |
| 987 result->SetAt(2, error_message); | 979 result->SetAt(2, error_message); |
| 988 return result; | 980 return result; |
| 989 } | 981 } |
| 990 | 982 |
| 991 } // namespace bin | 983 } // namespace bin |
| 992 } // namespace dart | 984 } // namespace dart |
| OLD | NEW |