Skip to content

Conversation

@jacoscaz
Copy link
Collaborator

@jacoscaz jacoscaz commented Jul 30, 2022

This PR complements #63 (which should be merged first) by renaming the _destination property to a dedicated Symbol, guaranteed to be unique, so that we can never trigger property collisions when setting _destination on externally-provided source objects for which isAsyncReadable(source) === true at

AsyncIterator/asynciterator.ts

Lines 2030 to 2043 in 159ed2b

protected _wrapSource(source: InternalSource<T>) {
try {
this._source = isAsyncReadable(source) ? source : fromSource(source);
}
catch (error) {
scheduleTask(() => this.emit('error', error));
return;
}
this._source._destination = this;
this._source.on('end', destinationClose);
this._source.on('error', destinationEmitError);
this._source.on('readable', destinationSetReadable);
this.readable = true;
}
.

@jacoscaz jacoscaz mentioned this pull request Jul 30, 2022
@RubenVerborgh RubenVerborgh self-assigned this Jul 31, 2022
@RubenVerborgh
Copy link
Owner

Thanks, @jacoscaz, I'm happy to take it from here!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants