Skip to content

fix: avoid to overwrite component options on IE <= 10 #203

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

Merged
merged 2 commits into from
Dec 3, 2017

Conversation

ktsn
Copy link
Member

@ktsn ktsn commented Nov 30, 2017

fix #192

Since IE <= 10 does not have __proto__, TypeScript just assigns the static properties of the super class in such environment. It causes the problem in static member forwarding.

The problem is the inherited properties are declared as same manner as the sub class property. Then the super component options (Ctor.options) are also enumerated in forwarding process and accidentally overwrite the extended Vue constructor.

To avoid this behavior, we can check equality of the reference of super class property and sub class property. If they are the same, we can say the property is inherited property.

Unfortunately, primitive values cannot be checked by this approach because the users may declare the same named properties with the same value. So I leave them to always forward for safety.

@HerringtonDarkholme @kaorun343
It would be appreciated if you input any comments/suggestion 🙏

@ktsn ktsn merged commit 8905f8c into master Dec 3, 2017
@ktsn ktsn deleted the fix-static-forwarding-ie branch December 3, 2017 13:17
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.

Life cycle functions never called in IE9 and 10 when using typescript
2 participants