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

chore(extensions/console): avoid re-checking iterable type #11349

Merged
merged 4 commits into from
Jul 26, 2021

Conversation

littledivy
Copy link
Member

simplifies value.entries() primordial logic with options.typeName

Copy link
Member

@lucacasonato lucacasonato left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could these not differ if the inspected type is an instance of for example Set? So if the inspected type is of a user type class MySet extends Set.

@littledivy
Copy link
Member Author

littledivy commented Jul 12, 2021

Could these not differ if the inspected type is an instance of for example Set? So if the inspected type is of a user type class MySet extends Set.

inspectObject checks if value is instanceof Set ... which calls inspectSet ... which then sets options.typeName = "Set" and calls inspectIterable

This should cover your example of class MySet extends Set

@bartlomieju bartlomieju requested a review from kt3k July 23, 2021 12:20
Copy link
Member

@kt3k kt3k left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

This only avoids checking value instance Set twice (The first once is done in inspectObject). So this shouldn't cause any behavioral change as Divy says.

@bartlomieju bartlomieju merged commit df26a35 into denoland:main Jul 26, 2021
@littledivy littledivy deleted the console-simplify-typeName branch July 26, 2021 12:18
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.

None yet

4 participants