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

Leverage new is_type_of for iterator protocol #1450

Merged
merged 1 commit into from
Apr 12, 2019

Conversation

RReverser
Copy link
Member

Treats any object of shape { next: function } as an iterator via new is_type_of method. This is consistent with JavaScript iteration protocol which we already respect.

Also fixes a minor issue that is_function was unnecessarily called twice (once explicitly and once as part of dyn_into which now does the same check).

Treats any object of shape `{ next: function }` as an iterator via new `is_type_of` method. This is consistent with JavaScript iteration protocol which we already respect.

Also fixes a minor issue that `is_function` was unnecessarily called twice (once explicitly and once as part of `dyn_into` which now does the same check).
@alexcrichton alexcrichton merged commit 744b031 into rustwasm:master Apr 12, 2019
@alexcrichton
Copy link
Contributor

Thanks!

@RReverser RReverser deleted the iter-is-type-of branch April 12, 2019 19:49
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