| 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 <stdio.h> | 8 #include <stdio.h> |
| 9 #include <stdlib.h> | 9 #include <stdlib.h> |
| 10 #include <string.h> | 10 #include <string.h> |
| (...skipping 430 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 441 result_string = strdup(Dart_GetError(result)); | 441 result_string = strdup(Dart_GetError(result)); |
| 442 } | 442 } |
| 443 } | 443 } |
| 444 // Switch back to the isolate from which we generate the snapshot and | 444 // Switch back to the isolate from which we generate the snapshot and |
| 445 // create the source string for the specified uri. | 445 // create the source string for the specified uri. |
| 446 Dart_Handle result; | 446 Dart_Handle result; |
| 447 if (!failed) { | 447 if (!failed) { |
| 448 result = Dart_NewStringFromUTF8(payload, payload_length); | 448 result = Dart_NewStringFromUTF8(payload, payload_length); |
| 449 free(payload); | 449 free(payload); |
| 450 } else { | 450 } else { |
| 451 result = DartUtils::NewString(result_string); | 451 result = Dart_NewApiError(result_string); |
| 452 free(result_string); | 452 free(result_string); |
| 453 } | 453 } |
| 454 return result; | 454 return result; |
| 455 } | 455 } |
| 456 | 456 |
| 457 | 457 |
| 458 static Dart_Handle ResolveUriInWorkingDirectory(const char* script_uri) { | 458 static Dart_Handle ResolveUriInWorkingDirectory(const char* script_uri) { |
| 459 bool failed = false; | 459 bool failed = false; |
| 460 char* result_string = NULL; | 460 char* result_string = NULL; |
| 461 | 461 |
| (...skipping 921 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1383 EventHandler::Stop(); | 1383 EventHandler::Stop(); |
| 1384 return 0; | 1384 return 0; |
| 1385 } | 1385 } |
| 1386 | 1386 |
| 1387 } // namespace bin | 1387 } // namespace bin |
| 1388 } // namespace dart | 1388 } // namespace dart |
| 1389 | 1389 |
| 1390 int main(int argc, char** argv) { | 1390 int main(int argc, char** argv) { |
| 1391 return dart::bin::main(argc, argv); | 1391 return dart::bin::main(argc, argv); |
| 1392 } | 1392 } |
| OLD | NEW |