| 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 460 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 471 Dart_GetType(io_lib, platform_class_name, 0, NULL); | 471 Dart_GetType(io_lib, platform_class_name, 0, NULL); |
| 472 CHECK_RESULT(platform_type); | 472 CHECK_RESULT(platform_type); |
| 473 Dart_Handle script_name_name = DartUtils::NewString("_nativeScript"); | 473 Dart_Handle script_name_name = DartUtils::NewString("_nativeScript"); |
| 474 CHECK_RESULT(script_name_name); | 474 CHECK_RESULT(script_name_name); |
| 475 Dart_Handle dart_script = DartUtils::NewString(script_uri); | 475 Dart_Handle dart_script = DartUtils::NewString(script_uri); |
| 476 CHECK_RESULT(dart_script); | 476 CHECK_RESULT(dart_script); |
| 477 Dart_Handle set_script_name = | 477 Dart_Handle set_script_name = |
| 478 Dart_SetField(platform_type, script_name_name, dart_script); | 478 Dart_SetField(platform_type, script_name_name, dart_script); |
| 479 CHECK_RESULT(set_script_name); | 479 CHECK_RESULT(set_script_name); |
| 480 | 480 |
| 481 VmService::SendIsolateStartupMessage(Dart_GetMainPortId()); | 481 Dart_Handle debug_name = Dart_DebugName(); |
| 482 CHECK_RESULT(debug_name); |
| 483 VmService::SendIsolateStartupMessage(Dart_GetMainPortId(), debug_name); |
| 482 | 484 |
| 483 // Make the isolate runnable so that it is ready to handle messages. | 485 // Make the isolate runnable so that it is ready to handle messages. |
| 484 Dart_ExitScope(); | 486 Dart_ExitScope(); |
| 485 Dart_ExitIsolate(); | 487 Dart_ExitIsolate(); |
| 486 bool retval = Dart_IsolateMakeRunnable(isolate); | 488 bool retval = Dart_IsolateMakeRunnable(isolate); |
| 487 if (!retval) { | 489 if (!retval) { |
| 488 *error = strdup("Invalid isolate state - Unable to make it runnable"); | 490 *error = strdup("Invalid isolate state - Unable to make it runnable"); |
| 489 Dart_EnterIsolate(isolate); | 491 Dart_EnterIsolate(isolate); |
| 490 Dart_ShutdownIsolate(); | 492 Dart_ShutdownIsolate(); |
| 491 return NULL; | 493 return NULL; |
| (...skipping 372 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 864 | 866 |
| 865 return Process::GlobalExitCode(); | 867 return Process::GlobalExitCode(); |
| 866 } | 868 } |
| 867 | 869 |
| 868 } // namespace bin | 870 } // namespace bin |
| 869 } // namespace dart | 871 } // namespace dart |
| 870 | 872 |
| 871 int main(int argc, char** argv) { | 873 int main(int argc, char** argv) { |
| 872 return dart::bin::main(argc, argv); | 874 return dart::bin::main(argc, argv); |
| 873 } | 875 } |
| OLD | NEW |