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

Fix a minification issue with the __hasRegisterFinished property. #5584

Merged
merged 2 commits into from
Aug 27, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/legacy/class.js
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ function GenerateClassFromInfo(info, Base, behaviors) {
*/
// only proceed if the generated class' prototype has not been registered.
const generatedProto = PolymerGenerated.prototype;
if (!generatedProto.hasOwnProperty('__hasRegisterFinished')) {
if (!generatedProto.hasOwnProperty(JSCompiler_renameProperty('__hasRegisterFinished', generatedProto))) {
generatedProto.__hasRegisterFinished = true;
// ensure superclass is registered first.
super._registered();
Expand Down
2 changes: 1 addition & 1 deletion lib/legacy/legacy-element-mixin.js
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ export const LegacyElementMixin = dedupingMixin((base) => {
*/
_initializeProperties() {
let proto = Object.getPrototypeOf(this);
if (!proto.hasOwnProperty('__hasRegisterFinished')) {
if (!proto.hasOwnProperty(JSCompiler_renameProperty('__hasRegisterFinished', proto))) {
this._registered();
// backstop in case the `_registered` implementation does not set this
proto.__hasRegisterFinished = true;
Expand Down
4 changes: 2 additions & 2 deletions lib/mixins/properties-changed.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ export const PropertiesChanged = dedupingMixin(
*/
_createPropertyAccessor(property, readOnly) {
this._addPropertyToAttributeMap(property);
if (!this.hasOwnProperty('__dataHasAccessor')) {
if (!this.hasOwnProperty(JSCompiler_renameProperty('__dataHasAccessor', this))) {
this.__dataHasAccessor = Object.assign({}, this.__dataHasAccessor);
}
if (!this.__dataHasAccessor[property]) {
Expand All @@ -131,7 +131,7 @@ export const PropertiesChanged = dedupingMixin(
* @override
*/
_addPropertyToAttributeMap(property) {
if (!this.hasOwnProperty('__dataAttributes')) {
if (!this.hasOwnProperty(JSCompiler_renameProperty('__dataAttributes', this))) {
this.__dataAttributes = Object.assign({}, this.__dataAttributes);
}
if (!this.__dataAttributes[property]) {
Expand Down
2 changes: 1 addition & 1 deletion lib/mixins/properties-mixin.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ export const PropertiesMixin = dedupingMixin(superClass => {
* @nocollapse
*/
static get observedAttributes() {
if (!this.hasOwnProperty('__observedAttributes')) {
if (!this.hasOwnProperty(JSCompiler_renameProperty('__observedAttributes', this))) {
register(this.prototype);
const props = this._properties;
this.__observedAttributes = props ? Object.keys(props).map(p => this.attributeNameForProperty(p)) : [];
Expand Down