Skip to content

fix: fix a deprecation warning that is shown when debug command is executed using node v10 #3635

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 1, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/device-sockets/ios/packet-stream.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export class PacketStream extends stream.Transform {
if (!this.buffer) {
// read length
const length = packet.readInt32BE(0);
this.buffer = new Buffer(length);
this.buffer = Buffer.allocUnsafe(length);
this.offset = 0;
packet = packet.slice(4);
}
Expand Down
2 changes: 1 addition & 1 deletion lib/device-sockets/ios/socket-proxy-factory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ export class SocketProxyFactory extends EventEmitter implements ISocketProxyFact

webSocket.on("message", (message: string) => {
const length = Buffer.byteLength(message, encoding);
const payload = new Buffer(length + 4);
const payload = Buffer.allocUnsafe(length + 4);
payload.writeInt32BE(length, 0);
payload.write(message, 4, length, encoding);
deviceSocket.write(payload);
Expand Down
2 changes: 1 addition & 1 deletion lib/services/livesync/android-device-livesync-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ export class AndroidDeviceLiveSyncService extends DeviceLiveSyncServiceBase impl
const socket = new net.Socket();

socket.connect(this.port, '127.0.0.1', () => {
socket.write(new Buffer([0, 0, 0, 1, 1]));
socket.write(Buffer.from([0, 0, 0, 1, 1]));
});
socket.on("data", (data: any) => {
isResolved = true;
Expand Down
2 changes: 1 addition & 1 deletion lib/services/livesync/ios-device-livesync-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ export class IOSDeviceLiveSyncService extends DeviceLiveSyncServiceBase implemen
await new Promise<void>((resolve, reject) => {
let isResolved = false;
const length = Buffer.byteLength(message, "utf16le");
const payload = new Buffer(length + 4);
const payload = Buffer.allocUnsafe(length + 4);
payload.writeInt32BE(length, 0);
payload.write(message, 4, length, "utf16le");

Expand Down