Compare commits

..

2 Commits

2 changed files with 4 additions and 4 deletions

4
dist/util.js vendored
View File

@ -83,12 +83,12 @@ export function createHash(data) {
export async function setupStream(stream) { export async function setupStream(stream) {
const existing = stream[RPC_PROTOCOL_SYMBOL]; const existing = stream[RPC_PROTOCOL_SYMBOL];
if (existing) { if (existing) {
await existing._channel.ready; await existing.ready;
return existing; return existing;
} }
const rpc = new RPC(stream); const rpc = new RPC(stream);
stream[RPC_PROTOCOL_SYMBOL] = rpc; stream[RPC_PROTOCOL_SYMBOL] = rpc;
await existing.ready; await rpc.ready;
return rpc; return rpc;
} }
export async function maybeGetAsyncProperty(object) { export async function maybeGetAsyncProperty(object) {

View File

@ -118,14 +118,14 @@ export function createHash(data: string): Buffer {
export async function setupStream(stream: any) { export async function setupStream(stream: any) {
const existing = stream[RPC_PROTOCOL_SYMBOL]; const existing = stream[RPC_PROTOCOL_SYMBOL];
if (existing) { if (existing) {
await existing._channel.ready; await existing.ready;
return existing; return existing;
} }
const rpc = new RPC(stream); const rpc = new RPC(stream);
stream[RPC_PROTOCOL_SYMBOL] = rpc; stream[RPC_PROTOCOL_SYMBOL] = rpc;
await existing.ready; await rpc.ready;
return rpc; return rpc;
} }