Skip to content

Commit f5c95f6

Browse files
Update several string references which can be renamed by closure-compiler
1 parent d1f36d8 commit f5c95f6

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

lib/elements/array-selector.html

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@
122122

123123
__updateSelection(multi, itemsInfo) {
124124
let path = itemsInfo.path;
125-
if (path == 'items') {
125+
if (path == JSCompiler_renameProperty('items', this)) {
126126
// Case 1 - items array changed, so diff against previous array and
127127
// deselect any removed items and adjust selected indices
128128
let newItems = itemsInfo.base || [];
@@ -137,14 +137,14 @@
137137
}
138138
this.__lastItems = newItems;
139139
this.__lastMulti = multi;
140-
} else if (itemsInfo.path == 'items.splices') {
140+
} else if (itemsInfo.path == `${JSCompiler_renameProperty('items', this)}.splices`) {
141141
// Case 2 - got specific splice information describing the array mutation:
142142
// deselect any removed items and adjust selected indices
143143
this.__applySplices(itemsInfo.value.indexSplices);
144144
} else {
145145
// Case 3 - an array element was changed, so deselect the previous
146146
// item for that index if it was previously selected
147-
let part = path.slice('items.'.length);
147+
let part = path.slice(`${JSCompiler_renameProperty('items', this)}.`.length);
148148
let idx = parseInt(part, 10);
149149
if ((part.indexOf('.') < 0) && part == idx) {
150150
this.__deselectChangedIdx(idx);
@@ -182,7 +182,7 @@
182182
selected.forEach((idx, item) => {
183183
if (idx < 0) {
184184
if (this.multi) {
185-
this.splice('selected', sidx, 1);
185+
this.splice(JSCompiler_renameProperty('selected', this), sidx, 1);
186186
} else {
187187
this.selected = this.selectedItem = null;
188188
}
@@ -199,13 +199,13 @@
199199
let sidx = 0;
200200
this.__selectedMap.forEach(idx => {
201201
if (idx >= 0) {
202-
this.linkPaths('items.' + idx, 'selected.' + sidx++);
202+
this.linkPaths(`${JSCompiler_renameProperty('items', this)}.` + idx, `${JSCompiler_renameProperty('selected', this)}.` + sidx++);
203203
}
204204
});
205205
} else {
206206
this.__selectedMap.forEach(idx => {
207-
this.linkPaths('selected', 'items.' + idx);
208-
this.linkPaths('selectedItem', 'items.' + idx);
207+
this.linkPaths(JSCompiler_renameProperty('selected', this), `${JSCompiler_renameProperty('items', this)}.` + idx);
208+
this.linkPaths(JSCompiler_renameProperty('selectedItem', this), `${JSCompiler_renameProperty('items', this)}.` + idx);
209209
});
210210
}
211211
}
@@ -260,9 +260,9 @@
260260
}
261261

262262
__selectedIndexForItemIndex(idx) {
263-
let selected = this.__dataLinkedPaths['items.' + idx];
263+
let selected = this.__dataLinkedPaths[`${JSCompiler_renameProperty('items', this)}.` + idx];
264264
if (selected) {
265-
return parseInt(selected.slice('selected.'.length), 10);
265+
return parseInt(selected.slice(`${JSCompiler_renameProperty('selected', this)}.`.length), 10);
266266
}
267267
}
268268

@@ -282,7 +282,7 @@
282282
}
283283
this.__updateLinks();
284284
if (this.multi) {
285-
this.splice('selected', sidx, 1);
285+
this.splice(JSCompiler_renameProperty('selected', this), sidx, 1);
286286
} else {
287287
this.selected = this.selectedItem = null;
288288
}
@@ -326,7 +326,7 @@
326326
this.__selectedMap.set(item, idx);
327327
this.__updateLinks();
328328
if (this.multi) {
329-
this.push('selected', item);
329+
this.push(JSCompiler_renameProperty('selected', this), item);
330330
} else {
331331
this.selected = this.selectedItem = item;
332332
}

lib/elements/dom-repeat.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -384,7 +384,7 @@
384384
if (prop == this.as) {
385385
this.items[idx] = value;
386386
}
387-
let path = Polymer.Path.translate(this.as, 'items.' + idx, prop);
387+
let path = Polymer.Path.translate(this.as, `${JSCompiler_renameProperty('items', this)}.` + idx, prop);
388388
this.notifyPath(path, value);
389389
}
390390
}

0 commit comments

Comments
 (0)