| 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 #include "bin/dartutils.h" | 5 #include "bin/dartutils.h" |
| 6 #include "bin/dbg_connection.h" |
| 7 #include "bin/eventhandler.h" |
| 6 #include "bin/io_buffer.h" | 8 #include "bin/io_buffer.h" |
| 7 #include "bin/platform.h" | 9 #include "bin/platform.h" |
| 8 #include "bin/process.h" | 10 #include "bin/process.h" |
| 9 #include "bin/socket.h" | 11 #include "bin/socket.h" |
| 10 #include "bin/utils.h" | 12 #include "bin/utils.h" |
| 11 | 13 |
| 12 #include "include/dart_api.h" | 14 #include "include/dart_api.h" |
| 13 | 15 |
| 14 namespace dart { | 16 namespace dart { |
| 15 namespace bin { | 17 namespace bin { |
| (...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 211 Dart_SetReturnValue(args, Dart_NewBoolean(success)); | 213 Dart_SetReturnValue(args, Dart_NewBoolean(success)); |
| 212 } | 214 } |
| 213 | 215 |
| 214 | 216 |
| 215 void FUNCTION_NAME(Process_Exit)(Dart_NativeArguments args) { | 217 void FUNCTION_NAME(Process_Exit)(Dart_NativeArguments args) { |
| 216 int64_t status = 0; | 218 int64_t status = 0; |
| 217 // Ignore result if passing invalid argument and just exit 0. | 219 // Ignore result if passing invalid argument and just exit 0. |
| 218 DartUtils::GetInt64Value(Dart_GetNativeArgument(args, 0), &status); | 220 DartUtils::GetInt64Value(Dart_GetNativeArgument(args, 0), &status); |
| 219 Dart_ExitIsolate(); | 221 Dart_ExitIsolate(); |
| 220 Dart_Cleanup(); | 222 Dart_Cleanup(); |
| 223 DebuggerConnectionHandler::StopHandler(); |
| 224 EventHandler::Stop(); |
| 221 exit(static_cast<int>(status)); | 225 exit(static_cast<int>(status)); |
| 222 } | 226 } |
| 223 | 227 |
| 224 | 228 |
| 225 void FUNCTION_NAME(Process_SetExitCode)(Dart_NativeArguments args) { | 229 void FUNCTION_NAME(Process_SetExitCode)(Dart_NativeArguments args) { |
| 226 int64_t status = 0; | 230 int64_t status = 0; |
| 227 // Ignore result if passing invalid argument and just set exit code to 0. | 231 // Ignore result if passing invalid argument and just set exit code to 0. |
| 228 DartUtils::GetInt64Value(Dart_GetNativeArgument(args, 0), &status); | 232 DartUtils::GetInt64Value(Dart_GetNativeArgument(args, 0), &status); |
| 229 Process::SetGlobalExitCode(status); | 233 Process::SetGlobalExitCode(status); |
| 230 } | 234 } |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 336 free(const_cast<char*>(system_string)); | 340 free(const_cast<char*>(system_string)); |
| 337 Dart_PropagateError(result); | 341 Dart_PropagateError(result); |
| 338 } | 342 } |
| 339 memmove(buffer, system_string, system_len); | 343 memmove(buffer, system_string, system_len); |
| 340 free(const_cast<char*>(system_string)); | 344 free(const_cast<char*>(system_string)); |
| 341 Dart_SetReturnValue(args, external_array); | 345 Dart_SetReturnValue(args, external_array); |
| 342 } | 346 } |
| 343 | 347 |
| 344 } // namespace bin | 348 } // namespace bin |
| 345 } // namespace dart | 349 } // namespace dart |
| OLD | NEW |