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

EventCache: Replaced property access to WeakMap access #423

Closed

Conversation

cyfung1031
Copy link

@cyfung1031 cyfung1031 commented May 3, 2023

As per #383. Shall resolve #317 as well. Once PR merged, closes #383.

Chrome 36+, Edge 12+, Safari 8+, Firefox 6+, Opera 23+, IE 11+
caniuse - WeakMap

Besides, "lib": ["ES2015.Collection"] is added to tsconfig.json
(Map, Set, WeakMap, WeakSet are added to TypeScript)

Please note that, element clone would not copy the event cache. This matches the result that element.cloneNode(true) would not copy the event handlers attached to the original node.

As per fabiospampinato#383.

Chrome 36+, Edge 12+, Safari 8+, Firefox 6+, Opera 23+, IE 11+
[caniuse - WeakMap](https://caniuse.com/?search=WeakMap())

Besides, `"lib": ["ES2015.Collection"]` is added to `tsconfig.json` (`Map`, `Set`, `WeakMap`, `WeakSet` are added to TypeScript)
cyfung1031 added a commit to cyfung1031/jquery-cash that referenced this pull request May 3, 2023
As per introduction of `WeakMap` in fabiospampinato#423 and dropped `initEvent` with IE11 in fabiospampinato#422.
@fabiospampinato
Copy link
Owner

Shall resolve #317 as well.

How so? I see an object with a prototype being created just the same.

@cyfung1031
Copy link
Author

Shall resolve #317 as well.

How so? I see an object with a prototype being created just the same.

Yes you are right. Not helping #317. The Map shall be implemented in each DOM

@cyfung1031 cyfung1031 closed this May 23, 2023
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.

Prototype inheritance bug Suggestion - Using WeakMap() for EventCache
2 participants