-
Notifications
You must be signed in to change notification settings - Fork 492
Move WeakMap polyfill to the beginning. #234
Move WeakMap polyfill to the beginning. #234
Conversation
threeday0905
commented
Mar 10, 2015
- webcomponents-lite.js - WeakMap polyfill may be executed before MutationObserver
- webcomponent.js - Move WeakMap polyfill outside condition statement.
* webcomponents-lite.js - WeakMap polyfill may be executed before MutationObserver * webcomponent.js - Move WeakMap polyfill outside condition statement.
Thanks for your PR. Could you sign our CLA so we can move ahead with reviewing your changes? Also: could you include some more details where the current build setup/positioning is causing breakage? |
This looks like it could be related to #210. |
Hi, CLA has been signed. I think this issue is same as #210. In this pr, I just update build.json and build-lite.json to move WeakMap polyfill in front of the file, the reason as following. In current webcomponents-lite.js build, WeakMap is polyfill after than MutationObserver. But MutationObserver is depend on WeakMap, like below:
So if browser does not support WeakMap (like older version chrome, in china), it will cause some exception. And if swap WeakMap and MutationObserver, the code works good. In webcomponents.js build, WeakMap polyfill is inside a shadow dom block like below:
I think WeakMap polyfill and ShadowDom polyfill is independent module, so I update the build.json to move WeakMap outside ShadowDom polyfill. |
@paulie4 would this address any of the issues you were seeing? |
oops, I forgot to switch to my personal account. I will close this PR. |
@addyosmani, yes it does, thanks @threeday0905! BTW, was this PR already pulled into https://github.com/webcomponents/webcomponentsjs, cause I don't see that it has? |
@paulie4, actually I close this pr without merge. should I reopen this pr? |
Why did you close the pull request? |
I use I am using the other email (not github account) to commit this change. So that I close this pr and revert that commit. If it is ok, free feel to reopen this pr and merge it. |
I am using the other email (not github account) to commit this change. So that I close this pr and revert that commit. If it is ok, free feel to reopen this pr and merge it. |
I am not a contributor to this project, so someone else would need to merge this pull request (and reopen it, if necessary). |
This issue (in Safari 7, WeakMap being undefined) remains an issue. @threeday0905 are you planning on committing this with a different GitHub account? If not, does someone else need to create a new pull request with these changes? |
@saranrapjs, I had created another PR based on latest master branch, #240. |