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

[Locker] Properties created lazily on LightningElement are not skipped by Locker #515

Closed
ravijayaramappa opened this issue Jul 17, 2018 · 1 comment · Fixed by #517
Closed
Milestone

Comments

@ravijayaramappa
Copy link
Contributor

ravijayaramappa commented Jul 17, 2018

Description

globalInitialization() is lazily defining aria properties and some standard HTML properties on LightningElement's prototype. This routine is invoked the first time a component has been initialized.

Locker wrapping of LightningElement happens before this. And the wrapping process assumes that all required properties of LightningElement's prototype are defined before the wrapping happens.

Because of the chronology of these two events, all of the lazily defined properties on LightningElement's prototype are not captured in the SecureLightningElement.

Steps to Reproduce

Create a lockerzied module with this structure. Notice the dom tree created, c-child will be created without the id attribute. (note: locker might add some workaround this issue, so talk to the locker team about this issue)

<c-foo>
   <c-child id="child"> </c-child>
</c-foo>

Possible Solution
globalInitialization() should not happen lazily, it should be invoked eagerly. or define all properties of LightningElement's protoype at declaration time.
Additional context/Screenshots
Add any other context about the problem here. If applicable, add screenshots to help explain.

@ravijayaramappa
Copy link
Contributor Author

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants