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

refactor: use primordials in runtime, extensions and core #11500

Merged
merged 16 commits into from
Jul 26, 2021

Conversation

magurotuna
Copy link
Member

I'm implementing new lint rule prefer-primordials. To see if it works fine I ran this rule for the runtime, extensions, and core JS code. The linter found a bunch of spots where primordials could be used, so this PR fixes them.

ref #11224

const globalIteratorPrototype = ObjectGetPrototypeOf(ObjectGetPrototypeOf(
[][SymbolIterator](),
));
const globalIteratorPrototype = ObjectGetPrototypeOf(ArrayIteratorPrototype);
Copy link
Member Author

Choose a reason for hiding this comment

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

Not really sure if this change is fine.
Otherwise, could [][SymbolIterator]() be replaced with primordials.ArrayPrototype[SymbolIterator]()? If it could I'd be happy to replace it.

Copy link
Member

Choose a reason for hiding this comment

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

I'm also not entirely sure if this is correct, but I'm going to tentatively land it

Copy link
Member

@bartlomieju bartlomieju left a comment

Choose a reason for hiding this comment

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

LGTM, thank you @magurotuna

@bartlomieju bartlomieju merged commit 865d9dd into denoland:main Jul 26, 2021
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

2 participants