| 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 <stdlib.h> | 5 #include <stdlib.h> |
| 6 #include <string.h> | 6 #include <string.h> |
| 7 #include <stdio.h> | 7 #include <stdio.h> |
| 8 | 8 |
| 9 #include "include/dart_api.h" | 9 #include "include/dart_api.h" |
| 10 #include "include/dart_debugger_api.h" | 10 #include "include/dart_debugger_api.h" |
| (...skipping 580 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 591 // closures and setting up 'package root' for URI resolution. | 591 // closures and setting up 'package root' for URI resolution. |
| 592 result = DartUtils::PrepareForScriptLoading(package_root, builtin_lib); | 592 result = DartUtils::PrepareForScriptLoading(package_root, builtin_lib); |
| 593 CHECK_RESULT(result); | 593 CHECK_RESULT(result); |
| 594 | 594 |
| 595 IsolateData* isolate_data = reinterpret_cast<IsolateData*>(data); | 595 IsolateData* isolate_data = reinterpret_cast<IsolateData*>(data); |
| 596 ASSERT(isolate_data != NULL); | 596 ASSERT(isolate_data != NULL); |
| 597 ASSERT(isolate_data->script_url != NULL); | 597 ASSERT(isolate_data->script_url != NULL); |
| 598 result = DartUtils::LoadScript(isolate_data->script_url, builtin_lib); | 598 result = DartUtils::LoadScript(isolate_data->script_url, builtin_lib); |
| 599 CHECK_RESULT(result); | 599 CHECK_RESULT(result); |
| 600 | 600 |
| 601 if (Dart_IsVMFlagSet("load_async")) { | 601 // Run event-loop and wait for script loading to complete. |
| 602 result = Dart_RunLoop(); | 602 result = Dart_RunLoop(); |
| 603 CHECK_RESULT(result); | 603 CHECK_RESULT(result); |
| 604 } | |
| 605 | 604 |
| 606 Platform::SetPackageRoot(package_root); | 605 Platform::SetPackageRoot(package_root); |
| 607 Dart_Handle io_lib_url = DartUtils::NewString(DartUtils::kIOLibURL); | 606 Dart_Handle io_lib_url = DartUtils::NewString(DartUtils::kIOLibURL); |
| 608 CHECK_RESULT(io_lib_url); | 607 CHECK_RESULT(io_lib_url); |
| 609 Dart_Handle io_lib = Dart_LookupLibrary(io_lib_url); | 608 Dart_Handle io_lib = Dart_LookupLibrary(io_lib_url); |
| 610 CHECK_RESULT(io_lib); | 609 CHECK_RESULT(io_lib); |
| 611 Dart_Handle platform_type = DartUtils::GetDartType(DartUtils::kIOLibURL, | 610 Dart_Handle platform_type = DartUtils::GetDartType(DartUtils::kIOLibURL, |
| 612 "_Platform"); | 611 "_Platform"); |
| 613 CHECK_RESULT(platform_type); | 612 CHECK_RESULT(platform_type); |
| 614 Dart_Handle script_name = DartUtils::NewString("_nativeScript"); | 613 Dart_Handle script_name = DartUtils::NewString("_nativeScript"); |
| (...skipping 555 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1170 exit(Process::GlobalExitCode()); | 1169 exit(Process::GlobalExitCode()); |
| 1171 } | 1170 } |
| 1172 | 1171 |
| 1173 } // namespace bin | 1172 } // namespace bin |
| 1174 } // namespace dart | 1173 } // namespace dart |
| 1175 | 1174 |
| 1176 int main(int argc, char** argv) { | 1175 int main(int argc, char** argv) { |
| 1177 dart::bin::main(argc, argv); | 1176 dart::bin::main(argc, argv); |
| 1178 UNREACHABLE(); | 1177 UNREACHABLE(); |
| 1179 } | 1178 } |
| OLD | NEW |