Sitelet https://web.archive.org/web/20230131225748/https://github.com/microsoft/TypeScript/pull/47926
Skip to content
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

[Do not merge] Remove TNext from Iterators #47926

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

qm3ster
Copy link

@qm3ster qm3ster commented Feb 17, 2022

Doesn't look like it is actually needed anywhere?

notes irrelevant to the proposal

Stubbed out src/harness/collectionsImpl.ts::closeIterator (which doesn't fail a single test lol) because whenever I tried to do something like

export function closeIterator<T>(iterator: Iterator<T> | Generator<T>) {
    // Iterators don't have to have a return method
    // eslint-disable-next-line no-in-operator
    if ("return" in iterator && typeof iterator.return === "function") iterator.return.call(iterator);
}

I would get test timeouts (flaky?)

Actually not sure how this is meant to be written according to the enforced styles, since truthiness doesn't narrow it, and typeof is not allowed on the | undefined field.
Object.prototype.hasOwnProperty definitely isn't appropriate here.

@typescript-bot
Copy link
Collaborator

It looks like you've sent a pull request to update our 'lib' files. These files aren't meant to be edited by hand, as they consist of last-known good states of the compiler and are generated from 'src/lib' or possibly our lib generator. Unless this is necessary, consider closing the pull request and sending a separate PR to update 'src/lib' or https://github.com/microsoft/TypeScript-DOM-lib-generator

@typescript-bot typescript-bot added For Uncommitted Bug PR for untriaged, rejected, closed or missing bug lib update PR modifies files in the `lib` folder labels Feb 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
For Uncommitted Bug PR for untriaged, rejected, closed or missing bug lib update PR modifies files in the `lib` folder
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants