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" | 6 #include "bin/dbg_connection.h" |
7 #include "bin/eventhandler.h" | 7 #include "bin/eventhandler.h" |
8 #include "bin/io_buffer.h" | 8 #include "bin/io_buffer.h" |
9 #include "bin/log.h" | 9 #include "bin/log.h" |
10 #include "bin/platform.h" | 10 #include "bin/platform.h" |
(...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
266 // Note that this dependency crosses logical project boundaries by making | 266 // Note that this dependency crosses logical project boundaries by making |
267 // the dart:io implementation depend upon the standalone VM's legacy debug | 267 // the dart:io implementation depend upon the standalone VM's legacy debug |
268 // protocol. This breaks projects which want to use our dart:io | 268 // protocol. This breaks projects which want to use our dart:io |
269 // implementation. Because the protocol is going away shortly, it's | 269 // implementation. Because the protocol is going away shortly, it's |
270 // reasonable to leave it behind a #ifdef that is only enabled for the | 270 // reasonable to leave it behind a #ifdef that is only enabled for the |
271 // standalone VM for now. | 271 // standalone VM for now. |
272 DebuggerConnectionHandler::StopHandler(); | 272 DebuggerConnectionHandler::StopHandler(); |
273 #endif | 273 #endif |
274 EventHandler::Stop(); | 274 EventHandler::Stop(); |
275 } | 275 } |
276 exit(static_cast<int>(status)); | 276 Platform::Exit(static_cast<int>(status)); |
277 } | 277 } |
278 | 278 |
279 | 279 |
280 void FUNCTION_NAME(Process_SetExitCode)(Dart_NativeArguments args) { | 280 void FUNCTION_NAME(Process_SetExitCode)(Dart_NativeArguments args) { |
281 int64_t status = 0; | 281 int64_t status = 0; |
282 // Ignore result if passing invalid argument and just set exit code to 0. | 282 // Ignore result if passing invalid argument and just set exit code to 0. |
283 DartUtils::GetInt64Value(Dart_GetNativeArgument(args, 0), &status); | 283 DartUtils::GetInt64Value(Dart_GetNativeArgument(args, 0), &status); |
284 Process::SetGlobalExitCode(status); | 284 Process::SetGlobalExitCode(status); |
285 } | 285 } |
286 | 286 |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
391 free(const_cast<char*>(system_string)); | 391 free(const_cast<char*>(system_string)); |
392 Dart_PropagateError(result); | 392 Dart_PropagateError(result); |
393 } | 393 } |
394 memmove(buffer, system_string, system_len); | 394 memmove(buffer, system_string, system_len); |
395 free(const_cast<char*>(system_string)); | 395 free(const_cast<char*>(system_string)); |
396 Dart_SetReturnValue(args, external_array); | 396 Dart_SetReturnValue(args, external_array); |
397 } | 397 } |
398 | 398 |
399 } // namespace bin | 399 } // namespace bin |
400 } // namespace dart | 400 } // namespace dart |
OLD | NEW |