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 384 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
395 } | 395 } |
396 } | 396 } |
397 Dart_Handle io_lib_url = DartUtils::NewString("dart:io"); | 397 Dart_Handle io_lib_url = DartUtils::NewString("dart:io"); |
398 if (Dart_IsError(io_lib_url)) { | 398 if (Dart_IsError(io_lib_url)) { |
399 return io_lib_url; | 399 return io_lib_url; |
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 platform_class_name = |
406 DartUtils::NewString("_OptionsImpl"); | 406 DartUtils::NewString("Platform"); |
407 if (Dart_IsError(runtime_options_class_name)) { | 407 if (Dart_IsError(platform_class_name)) { |
408 return runtime_options_class_name; | 408 return platform_class_name; |
409 } | 409 } |
410 Dart_Handle runtime_options_class = Dart_GetClass( | 410 Dart_Handle platform_class = Dart_GetClass( |
Ivan Posva
2013/06/24 21:16:46
It seems that this CL is out of sync. Dart_GetClas
| |
411 io_lib, runtime_options_class_name); | 411 io_lib, platform_class_name); |
412 if (Dart_IsError(runtime_options_class)) { | 412 if (Dart_IsError(platform_class)) { |
413 return runtime_options_class; | 413 return platform_class; |
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(platform_class, |
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(platform_class, 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 runtime_options_class_name = | |
437 DartUtils::NewString("_OptionsImpl"); | |
438 if (Dart_IsError(runtime_options_class_name)) { | |
439 return runtime_options_class_name; | |
440 } | |
441 Dart_Handle runtime_options_class = Dart_GetClass( | |
Ivan Posva
2013/06/24 21:16:46
Please use Dart_GetType instead of Dart_GetClass.
| |
442 io_lib, runtime_options_class_name); | |
443 if (Dart_IsError(runtime_options_class)) { | |
444 return runtime_options_class; | |
445 } | |
436 Dart_Handle native_name = DartUtils::NewString("_nativeArguments"); | 446 Dart_Handle native_name = DartUtils::NewString("_nativeArguments"); |
437 if (Dart_IsError(native_name)) { | 447 if (Dart_IsError(native_name)) { |
438 return native_name; | 448 return native_name; |
439 } | 449 } |
440 | 450 |
441 return Dart_SetField(runtime_options_class, native_name, dart_arguments); | 451 return Dart_SetField(runtime_options_class, native_name, dart_arguments); |
442 } | 452 } |
443 | 453 |
444 | 454 |
445 #define CHECK_RESULT(result) \ | 455 #define CHECK_RESULT(result) \ |
(...skipping 427 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
873 | 883 |
874 return Process::GlobalExitCode(); | 884 return Process::GlobalExitCode(); |
875 } | 885 } |
876 | 886 |
877 } // namespace bin | 887 } // namespace bin |
878 } // namespace dart | 888 } // namespace dart |
879 | 889 |
880 int main(int argc, char** argv) { | 890 int main(int argc, char** argv) { |
881 return dart::bin::main(argc, argv); | 891 return dart::bin::main(argc, argv); |
882 } | 892 } |
OLD | NEW |