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

make exportmap procedures static instead of monkeypatching exportmap #2982

Merged
1 commit merged into from Mar 13, 2024

Conversation

soryy708
Copy link
Contributor

@soryy708 soryy708 commented Mar 13, 2024

The following procedures:

ExportMap.get
ExportMap.for
ExportMap.parse

are conceptually static methods of ExportMap, but instead of using the static keyword they are monkey-patched onto the ExportMap class

ExportMap.get = function (...) {...}

which is surprising.

Lets make them static methods proper.


Tip for the reviewer/maintainer:

Use the "Hide whitespace" feature of GitHub's diff.

image

src/ExportMap.js Outdated Show resolved Hide resolved
Copy link
Member

@ljharb ljharb left a comment

Choose a reason for hiding this comment

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

thanks!

@ljharb
Copy link
Member

ljharb commented Mar 13, 2024

you're right that this repo doesn't enforce that rule for some reason; i'll fix it shortly :-)

@ljharb ljharb closed this pull request by merging all changes into import-js:main in 2efdf79 Mar 13, 2024
@soryy708 soryy708 deleted the monkeypatched-statics branch March 14, 2024 08:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants