| 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 389 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 400 } | 400 } |
| 401 Dart_Handle io_lib = Dart_LookupLibrary(io_lib_url); | 401 Dart_Handle io_lib = Dart_LookupLibrary(io_lib_url); |
| 402 if (Dart_IsError(io_lib)) { | 402 if (Dart_IsError(io_lib)) { |
| 403 return io_lib; | 403 return io_lib; |
| 404 } | 404 } |
| 405 Dart_Handle runtime_options_class_name = | 405 Dart_Handle runtime_options_class_name = |
| 406 DartUtils::NewString("_OptionsImpl"); | 406 DartUtils::NewString("_OptionsImpl"); |
| 407 if (Dart_IsError(runtime_options_class_name)) { | 407 if (Dart_IsError(runtime_options_class_name)) { |
| 408 return runtime_options_class_name; | 408 return runtime_options_class_name; |
| 409 } | 409 } |
| 410 Dart_Handle runtime_options_class = Dart_GetClass( | 410 Dart_Handle runtime_options_type = Dart_GetType( |
| 411 io_lib, runtime_options_class_name); | 411 io_lib, runtime_options_class_name, 0, NULL); |
| 412 if (Dart_IsError(runtime_options_class)) { | 412 if (Dart_IsError(runtime_options_type)) { |
| 413 return runtime_options_class; | 413 return runtime_options_type; |
| 414 } | 414 } |
| 415 Dart_Handle executable_name_name = | 415 Dart_Handle executable_name_name = |
| 416 DartUtils::NewString("_nativeExecutable"); | 416 DartUtils::NewString("_nativeExecutable"); |
| 417 if (Dart_IsError(executable_name_name)) { | 417 if (Dart_IsError(executable_name_name)) { |
| 418 return executable_name_name; | 418 return executable_name_name; |
| 419 } | 419 } |
| 420 Dart_Handle set_executable_name = | 420 Dart_Handle set_executable_name = |
| 421 Dart_SetField(runtime_options_class, | 421 Dart_SetField(runtime_options_type, |
| 422 executable_name_name, | 422 executable_name_name, |
| 423 dart_executable); | 423 dart_executable); |
| 424 if (Dart_IsError(set_executable_name)) { | 424 if (Dart_IsError(set_executable_name)) { |
| 425 return set_executable_name; | 425 return set_executable_name; |
| 426 } | 426 } |
| 427 Dart_Handle script_name_name = DartUtils::NewString("_nativeScript"); | 427 Dart_Handle script_name_name = DartUtils::NewString("_nativeScript"); |
| 428 if (Dart_IsError(script_name_name)) { | 428 if (Dart_IsError(script_name_name)) { |
| 429 return script_name_name; | 429 return script_name_name; |
| 430 } | 430 } |
| 431 Dart_Handle set_script_name = | 431 Dart_Handle set_script_name = |
| 432 Dart_SetField(runtime_options_class, script_name_name, dart_script); | 432 Dart_SetField(runtime_options_type, script_name_name, dart_script); |
| 433 if (Dart_IsError(set_script_name)) { | 433 if (Dart_IsError(set_script_name)) { |
| 434 return set_script_name; | 434 return set_script_name; |
| 435 } | 435 } |
| 436 Dart_Handle native_name = DartUtils::NewString("_nativeArguments"); | 436 Dart_Handle native_name = DartUtils::NewString("_nativeArguments"); |
| 437 if (Dart_IsError(native_name)) { | 437 if (Dart_IsError(native_name)) { |
| 438 return native_name; | 438 return native_name; |
| 439 } | 439 } |
| 440 | 440 |
| 441 return Dart_SetField(runtime_options_class, native_name, dart_arguments); | 441 return Dart_SetField(runtime_options_type, native_name, dart_arguments); |
| 442 } | 442 } |
| 443 | 443 |
| 444 | 444 |
| 445 #define CHECK_RESULT(result) \ | 445 #define CHECK_RESULT(result) \ |
| 446 if (Dart_IsError(result)) { \ | 446 if (Dart_IsError(result)) { \ |
| 447 *error = strdup(Dart_GetError(result)); \ | 447 *error = strdup(Dart_GetError(result)); \ |
| 448 Dart_ExitScope(); \ | 448 Dart_ExitScope(); \ |
| 449 Dart_ShutdownIsolate(); \ | 449 Dart_ShutdownIsolate(); \ |
| 450 return NULL; \ | 450 return NULL; \ |
| 451 } \ | 451 } \ |
| (...skipping 421 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 873 | 873 |
| 874 return Process::GlobalExitCode(); | 874 return Process::GlobalExitCode(); |
| 875 } | 875 } |
| 876 | 876 |
| 877 } // namespace bin | 877 } // namespace bin |
| 878 } // namespace dart | 878 } // namespace dart |
| 879 | 879 |
| 880 int main(int argc, char** argv) { | 880 int main(int argc, char** argv) { |
| 881 return dart::bin::main(argc, argv); | 881 return dart::bin::main(argc, argv); |
| 882 } | 882 } |
| OLD | NEW |