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 361 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
372 Dart_Handle argument_value = | 372 Dart_Handle argument_value = |
373 DartUtils::NewString(options->GetArgument(i)); | 373 DartUtils::NewString(options->GetArgument(i)); |
374 if (Dart_IsError(argument_value)) { | 374 if (Dart_IsError(argument_value)) { |
375 return argument_value; | 375 return argument_value; |
376 } | 376 } |
377 Dart_Handle result = Dart_ListSetAt(dart_arguments, i, argument_value); | 377 Dart_Handle result = Dart_ListSetAt(dart_arguments, i, argument_value); |
378 if (Dart_IsError(result)) { | 378 if (Dart_IsError(result)) { |
379 return result; | 379 return result; |
380 } | 380 } |
381 } | 381 } |
382 Dart_Handle core_lib_url = DartUtils::NewString("dart:core"); | 382 Dart_Handle io_lib_url = DartUtils::NewString("dart:io"); |
383 if (Dart_IsError(core_lib_url)) { | 383 if (Dart_IsError(io_lib_url)) { |
384 return core_lib_url; | 384 return io_lib_url; |
385 } | 385 } |
386 Dart_Handle core_lib = Dart_LookupLibrary(core_lib_url); | 386 Dart_Handle io_lib = Dart_LookupLibrary(io_lib_url); |
387 if (Dart_IsError(core_lib)) { | 387 if (Dart_IsError(io_lib)) { |
388 return core_lib; | 388 return io_lib; |
389 } | 389 } |
390 Dart_Handle runtime_options_class_name = | 390 Dart_Handle runtime_options_class_name = |
391 DartUtils::NewString("_OptionsImpl"); | 391 DartUtils::NewString("_OptionsImpl"); |
392 if (Dart_IsError(runtime_options_class_name)) { | 392 if (Dart_IsError(runtime_options_class_name)) { |
393 return runtime_options_class_name; | 393 return runtime_options_class_name; |
394 } | 394 } |
395 Dart_Handle runtime_options_class = Dart_GetClass( | 395 Dart_Handle runtime_options_class = Dart_GetClass( |
396 core_lib, runtime_options_class_name); | 396 io_lib, runtime_options_class_name); |
397 if (Dart_IsError(runtime_options_class)) { | 397 if (Dart_IsError(runtime_options_class)) { |
398 return runtime_options_class; | 398 return runtime_options_class; |
399 } | 399 } |
400 Dart_Handle executable_name_name = | 400 Dart_Handle executable_name_name = |
401 DartUtils::NewString("_nativeExecutable"); | 401 DartUtils::NewString("_nativeExecutable"); |
402 if (Dart_IsError(executable_name_name)) { | 402 if (Dart_IsError(executable_name_name)) { |
403 return executable_name_name; | 403 return executable_name_name; |
404 } | 404 } |
405 Dart_Handle set_executable_name = | 405 Dart_Handle set_executable_name = |
406 Dart_SetField(runtime_options_class, | 406 Dart_SetField(runtime_options_class, |
(...skipping 419 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
826 Dart_ShutdownIsolate(); | 826 Dart_ShutdownIsolate(); |
827 // Terminate process exit-code handler. | 827 // Terminate process exit-code handler. |
828 Process::TerminateExitCodeHandler(); | 828 Process::TerminateExitCodeHandler(); |
829 // Free copied argument strings if converted. | 829 // Free copied argument strings if converted. |
830 if (argv_converted) { | 830 if (argv_converted) { |
831 for (int i = 0; i < argc; i++) free(argv[i]); | 831 for (int i = 0; i < argc; i++) free(argv[i]); |
832 } | 832 } |
833 | 833 |
834 return Process::GlobalExitCode(); | 834 return Process::GlobalExitCode(); |
835 } | 835 } |
OLD | NEW |