Skip to content
This repository has been archived by the owner on Feb 11, 2021. It is now read-only.

Replace PointerMap with potentially-sparse-array-based Map polyfill #190

Closed
wants to merge 1 commit into from

Conversation

stuartpb
Copy link
Contributor

Alternative to gh-189

var USE_MAP = window.Map && window.Map.prototype.forEach;
var POINTERS_FN = function() { return this.size; };
var USE_MAP = window.Map && window.Map.prototype.forEach &&
!Object.getOwnPropertyDescriptor(Map.prototype,'size').value;
Copy link
Contributor

Choose a reason for hiding this comment

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

What is this guarding against?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

That's silly, why would we care about something that was fixed almost three years ago? Remove this.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That's silly, why would we care about something that was fixed almost three years ago?

Why check window.Map.prototype.forEach then?

@scottgonzalez
Copy link
Contributor

@stuartpb Are you able to attend our meeting today? It's on IRC at noon ET (#jquery-meeting on freenode).

@stuartpb
Copy link
Contributor Author

@scottgonzalez Sure, I can stay up for a few more hours.

@scottgonzalez
Copy link
Contributor

Is there a reason not to just use an object instead of an array?

narqo pushed a commit to bem/bem-core that referenced this pull request Jul 7, 2015
…y in IE Edge

Use native `PointerEvent` if supported.
fix #1066

Optimise PointerMap class: use native Map class if supported (port
of jquery-archive/PEP#190).
narqo pushed a commit to bem/bem-core that referenced this pull request Jul 7, 2015
…y in IE Edge

Use native `PointerEvent` if supported.
fix #1066

Optimise PointerMap class: use native Map class if supported (port
of jquery-archive/PEP#190).
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants