| 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 436 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 447 | 447 |
| 448 // Set up the library tag handler for this isolate. | 448 // Set up the library tag handler for this isolate. |
| 449 Dart_Handle result = Dart_SetLibraryTagHandler(DartUtils::LibraryTagHandler); | 449 Dart_Handle result = Dart_SetLibraryTagHandler(DartUtils::LibraryTagHandler); |
| 450 CHECK_RESULT(result); | 450 CHECK_RESULT(result); |
| 451 | 451 |
| 452 // Load the specified application script into the newly created isolate. | 452 // Load the specified application script into the newly created isolate. |
| 453 | 453 |
| 454 // Prepare builtin and its dependent libraries for use to resolve URIs. | 454 // Prepare builtin and its dependent libraries for use to resolve URIs. |
| 455 // The builtin library is part of the core snapshot and would already be | 455 // The builtin library is part of the core snapshot and would already be |
| 456 // available here in the case of script snapshot loading. | 456 // available here in the case of script snapshot loading. |
| 457 Dart_Handle uri_url = DartUtils::NewString(DartUtils::kUriLibURL); | |
| 458 Dart_Handle uri_lib = Dart_LookupLibrary(uri_url); | |
| 459 CHECK_RESULT(uri_lib); | |
| 460 Dart_Handle builtin_lib = | 457 Dart_Handle builtin_lib = |
| 461 Builtin::LoadAndCheckLibrary(Builtin::kBuiltinLibrary); | 458 Builtin::LoadAndCheckLibrary(Builtin::kBuiltinLibrary); |
| 462 CHECK_RESULT(builtin_lib); | 459 CHECK_RESULT(builtin_lib); |
| 463 | 460 |
| 464 // Prepare for script loading by setting up the 'print' and 'timer' | 461 // Prepare for script loading by setting up the 'print' and 'timer' |
| 465 // closures and setting up 'package root' for URI resolution. | 462 // closures and setting up 'package root' for URI resolution. |
| 466 result = DartUtils::PrepareForScriptLoading(package_root, builtin_lib); | 463 result = DartUtils::PrepareForScriptLoading(package_root, builtin_lib); |
| 467 CHECK_RESULT(result); | 464 CHECK_RESULT(result); |
| 468 | 465 |
| 469 Dart_Handle library = DartUtils::LoadScript(script_uri, builtin_lib); | 466 Dart_Handle library = DartUtils::LoadScript(script_uri, builtin_lib); |
| (...skipping 378 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 848 | 845 |
| 849 return Process::GlobalExitCode(); | 846 return Process::GlobalExitCode(); |
| 850 } | 847 } |
| 851 | 848 |
| 852 } // namespace bin | 849 } // namespace bin |
| 853 } // namespace dart | 850 } // namespace dart |
| 854 | 851 |
| 855 int main(int argc, char** argv) { | 852 int main(int argc, char** argv) { |
| 856 return dart::bin::main(argc, argv); | 853 return dart::bin::main(argc, argv); |
| 857 } | 854 } |
| OLD | NEW |