PDA

View Full Version : [FIXED-539] fix variable name (using JS keyword as name) (patch included)



uwolfer
7 Feb 2010, 7:55 AM
The attached patch fixes a var name which is uses an invalid JS keyword (each).


rename-var-because-of-reserved-word.txt


rename var because of reserved word

---
src/widgets/list/ColumnResizer.js | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/widgets/list/ColumnResizer.js b/src/widgets/list/ColumnResizer.js
index e3b1531..49485be 100644
--- a/src/widgets/list/ColumnResizer.js
+++ b/src/widgets/list/ColumnResizer.js
@@ -103,8 +103,8 @@ Ext.list.ColumnResizer = Ext.extend(Ext.util.Observable, {
minPct = this.minPct * 100,
pct = Math.ceil((nw * vw.maxWidth) / w),
diff = (cs[index].width * 100) - pct,
- each = Math.floor(diff / (len-1-index)),
- mod = diff - (each * (len-1-index));
+ eachItem = Math.floor(diff / (len-1-index)),
+ mod = diff - (eachItem * (len-1-index));

for(var i = index+1; i < len; i++){
var cw = (cs[i].width * 100) + each,
--
1.6.6.1

uwolfer
7 Feb 2010, 10:03 AM
Please note that the "each" also needs to be replaces a few lines below. I have missed that one in my patch.

(var cw = (cs[i].width * 100) + eachItem,)

Jamie Avins
26 Feb 2010, 11:39 AM
Fixed in SVN 6170.