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

Replace es6-map with a simple implementation of a map. #134

Merged
merged 3 commits into from
Jul 4, 2016

Conversation

srolel
Copy link
Contributor

@srolel srolel commented May 29, 2016

#133

Also, changed the npm run pragmatist command so that it works on windows as well.

@@ -1,4 +1,4 @@
import Map from 'es6-map';
import Map from './simple-map';
Copy link
Owner

Choose a reason for hiding this comment

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

simple-map is very generic. What about calling it simple-weak-map?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm not sure that is fitting, as keys are not weakly referenced like in a WeakMap. Your call though.

Choose a reason for hiding this comment

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

It's not a weak map. Nor is a weak map required here.

Copy link
Owner

Choose a reason for hiding this comment

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

The reason I have suggested "weak map" is because keys are objects. @benjamingr Can you suggest a better name?

Choose a reason for hiding this comment

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

Map, in regular ES2015 maps keys can be objects.

A WeakMap is a map that does not interfere with the garbage collection of its keys. If you'd like to see an example of why one would want to use it - see http://stackoverflow.com/questions/29413222/what-are-the-actual-uses-of-es6-weakmap . The "weakness" of the weak map is in that it holds the reference to the keys weakly.

Copy link
Owner

Choose a reason for hiding this comment

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

Thats useful. Thank you. Will keep it as simple-map then.

@benjamingr
Copy link

This should probably fall back to ES2015 maps if they are available.

@gajus gajus merged commit 92a5b37 into gajus:master Jul 4, 2016
@gajus
Copy link
Owner

gajus commented Jul 4, 2016

@mosho1 Thank you for the PR.

Version v3.7.7 has been released.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants