| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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 // Generate a snapshot file after loading all the scripts specified on the | 5 // Generate a snapshot file after loading all the scripts specified on the |
| 6 // command line. | 6 // command line. |
| 7 | 7 |
| 8 #include <stdlib.h> | 8 #include <stdlib.h> |
| 9 #include <string.h> | 9 #include <string.h> |
| 10 #include <stdio.h> | 10 #include <stdio.h> |
| (...skipping 431 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 442 Dart_Handle script_path = FilePathFromUri( | 442 Dart_Handle script_path = FilePathFromUri( |
| 443 DartUtils::GetStringValue(resolved_script_uri)); | 443 DartUtils::GetStringValue(resolved_script_uri)); |
| 444 if (Dart_IsError(script_path)) { | 444 if (Dart_IsError(script_path)) { |
| 445 return script_path; | 445 return script_path; |
| 446 } | 446 } |
| 447 Dart_Handle source = DartUtils::ReadStringFromFile( | 447 Dart_Handle source = DartUtils::ReadStringFromFile( |
| 448 DartUtils::GetStringValue(script_path)); | 448 DartUtils::GetStringValue(script_path)); |
| 449 if (Dart_IsError(source)) { | 449 if (Dart_IsError(source)) { |
| 450 return source; | 450 return source; |
| 451 } | 451 } |
| 452 return Dart_LoadScript(resolved_script_uri, source, 0, 0); | 452 return Dart_LoadLibrary(resolved_script_uri, source, 0, 0); |
| 453 } | 453 } |
| 454 | 454 |
| 455 | 455 |
| 456 static Dart_Handle LoadGenericSnapshotCreationScript( | 456 static Dart_Handle LoadGenericSnapshotCreationScript( |
| 457 Builtin::BuiltinLibraryId id) { | 457 Builtin::BuiltinLibraryId id) { |
| 458 Dart_Handle source = Builtin::Source(id); | 458 Dart_Handle source = Builtin::Source(id); |
| 459 if (Dart_IsError(source)) { | 459 if (Dart_IsError(source)) { |
| 460 return source; // source contains the error string. | 460 return source; // source contains the error string. |
| 461 } | 461 } |
| 462 Dart_Handle lib; | 462 Dart_Handle lib; |
| (...skipping 688 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1151 EventHandler::Stop(); | 1151 EventHandler::Stop(); |
| 1152 return 0; | 1152 return 0; |
| 1153 } | 1153 } |
| 1154 | 1154 |
| 1155 } // namespace bin | 1155 } // namespace bin |
| 1156 } // namespace dart | 1156 } // namespace dart |
| 1157 | 1157 |
| 1158 int main(int argc, char** argv) { | 1158 int main(int argc, char** argv) { |
| 1159 return dart::bin::main(argc, argv); | 1159 return dart::bin::main(argc, argv); |
| 1160 } | 1160 } |
| OLD | NEW |