mirror of
https://github.com/dart-lang/sdk
synced 2024-11-02 12:24:24 +00:00
Generate an error when starting Processes on iOS
Bug: https://github.com/dart-lang/sdk/issues/49650 Change-Id: I4fc6ab5fc964eabe45851e7a72abf0db92e2b2f2 TEST=manual :-( Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/254981 Reviewed-by: Alexander Aprelev <aam@google.com> Commit-Queue: Brian Quinlan <bquinlan@google.com>
This commit is contained in:
parent
878124b915
commit
8c49f519ce
1 changed files with 17 additions and 1 deletions
|
@ -82,10 +82,26 @@ void FUNCTION_NAME(Process_Start)(Dart_NativeArguments args) {
|
|||
Namespace* namespc = Namespace::GetNamespace(args, 1);
|
||||
Dart_Handle status_handle = Dart_GetNativeArgument(args, 11);
|
||||
Dart_Handle path_handle = Dart_GetNativeArgument(args, 2);
|
||||
Dart_Handle result;
|
||||
|
||||
#if DART_HOST_OS_IOS
|
||||
// Do the iOS check here because the return value of Process::Start is
|
||||
// interpreted as a error with 0 meaning success while `ProcessException`
|
||||
// (which will be constructed with `_errorCode`) interprets 0 to mean that
|
||||
// no OS error code was available.
|
||||
result = DartUtils::SetIntegerField(status_handle, "_errorCode", 0);
|
||||
ThrowIfError(result);
|
||||
result = DartUtils::SetStringField(
|
||||
status_handle, "_errorMessage",
|
||||
"Starting new processes is not supported on iOS");
|
||||
ThrowIfError(result);
|
||||
Dart_SetBooleanReturnValue(args, false);
|
||||
return;
|
||||
#endif
|
||||
|
||||
// The Dart code verifies that the path implements the String
|
||||
// interface. However, only builtin Strings are handled by
|
||||
// GetStringValue.
|
||||
Dart_Handle result;
|
||||
if (!Dart_IsString(path_handle)) {
|
||||
result = DartUtils::SetIntegerField(status_handle, "_errorCode", 0);
|
||||
ThrowIfError(result);
|
||||
|
|
Loading…
Reference in a new issue