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

Typescript implementation error on IE and Edge #404

Open
sandinosaso opened this issue Jun 25, 2019 · 1 comment
Open

Typescript implementation error on IE and Edge #404

sandinosaso opened this issue Jun 25, 2019 · 1 comment

Comments

@sandinosaso
Copy link

Hi, thank for sharing this I found a very hard to detect bug in IE10, IE11 and all the Edge versions.

In the typescript implementation for the Env it is used a Map() is used, and the whole MalSymbol object is used as a key for saving on that Map.

When doing this.data.has(key) being key an object (the MalSymbol) it returns false in IE, Edge even when I see the key is present in the Map object.

I think this may be a difference between the IE and Edge implementations when using objects as keys of a Map object, in Chrome and Firefox it works ok.

Using just the MalSymbol value of a key can fix the problem (this is how the pure JS implementation resolves this).

This implementation has the bug (because it uses a Map with object keys): https://github.com/kanaka/mal/blob/master/ts/env.ts
This is a good implementation: https://github.com/kanaka/mal/blob/master/js/env.js

Best regards.

@sandinosaso
Copy link
Author

This could be fixed adding a Map() polyfill

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

No branches or pull requests

1 participant