refactor: mark immutable array parameters as readonly

This commit is contained in:
Simon Chan 2025-06-16 16:32:49 +08:00
parent 40a60ca112
commit 6873c03a9d
No known key found for this signature in database
GPG key ID: A8B69F750B9BCEDD
24 changed files with 89 additions and 60 deletions

View file

@ -53,8 +53,9 @@ export class CmdNoneProtocolService extends AdbNoneProtocolSpawner {
throw new Error("Unsupported");
}
command[0] = fallback;
return adb.subprocess.noneProtocol.spawn(command);
const fallbackCommand = command.slice();
fallbackCommand[0] = fallback;
return adb.subprocess.noneProtocol.spawn(fallbackCommand);
});
this.#supportsCmd = adb.canUseFeature(AdbFeature.Cmd);
@ -116,8 +117,9 @@ export class CmdShellProtocolService extends AdbShellProtocolSpawner {
throw new Error("Unsupported");
}
command[0] = fallback;
return adb.subprocess.shellProtocol.spawn(command);
const fallbackCommand = command.slice();
fallbackCommand[0] = fallback;
return adb.subprocess.shellProtocol.spawn(fallbackCommand);
});
this.#adb = adb;