PDA

View Full Version : [FIXED-537][3.1.1-rc] fix unterminated statements (patch included)



uwolfer
7 Feb 2010, 7:52 AM
The attached patch fixes some unterminated statements issues in JS-code (missing ';').

Note: I have found these issues with Intellij IDEA code inspection and fixed them automatically which means it messed up a few lines with whitespace changes. I have reviewed the changes manually.


fix-unterminated-statements.txt


fix unterminated statements

---
src/adapter/core/ext-base-anim-extra.js | 10 +++++-----
src/adapter/core/ext-base-anim.js | 2 +-
src/core/Element.style-more.js | 2 +-
src/core/Error.js | 2 +-
src/core/core/EventManager.js | 16 ++++++++--------
src/data/Tree.js | 2 +-
src/data/XmlReader.js | 10 +++++-----
src/debug.js | 4 ++--
src/direct/Event.js | 4 ++--
src/direct/JsonProvider.js | 2 +-
src/util/Date.js | 8 ++++----
src/util/UpdateManager.js | 2 +-
src/widgets/PanelDD.js | 2 +-
src/widgets/chart/EventProxy.js | 8 ++++----
src/widgets/form/Form.js | 2 +-
src/widgets/layout/BoxLayout.js | 2 +-
src/widgets/list/ListView.js | 2 +-
src/widgets/tree/TreeEventModel.js | 4 ++--
18 files changed, 42 insertions(+), 42 deletions(-)

diff --git a/src/adapter/core/ext-base-anim-extra.js b/src/adapter/core/ext-base-anim-extra.js
index 90e7afe..0f3b3e3 100644
--- a/src/adapter/core/ext-base-anim-extra.js
+++ b/src/adapter/core/ext-base-anim-extra.js
@@ -140,7 +140,7 @@
// Color Animation
EXTLIB.Anim.color = function(el, args, duration, easing, cb, scope) {
return EXTLIB.Anim.run(el, args, duration, easing, cb, scope, EXTLIB.ColorAnim);
- }
+ };

EXTLIB.ColorAnim = function(el, attributes, duration, method) {
EXTLIB.ColorAnim.superclass.constructor.call(this, el, attributes, duration, method);
@@ -152,11 +152,11 @@
colorRE = /color$/i,
transparentRE = /^transparent|rgba\(0, 0, 0, 0\)$/,
rgbRE = /^rgb\(([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\)$/i,
- hexRE= /^#?([0-9A-F]{2})([0-9A-F]{2})([0-9A-F]{2})$/i,
+ hexRE = /^#?([0-9A-F]{2})([0-9A-F]{2})([0-9A-F]{2})$/i,
hex3RE = /^#?([0-9A-F]{1})([0-9A-F]{1})([0-9A-F]{1})$/i,
- isset = function(v){
+ isset = function(v) {
return typeof v !== 'undefined';
- }
+ };

// private
function parseColor(s) {
@@ -250,7 +250,7 @@
var EXTLIB = Ext.lib;
EXTLIB.Anim.scroll = function(el, args, duration, easing, cb, scope) {
return EXTLIB.Anim.run(el, args, duration, easing, cb, scope, EXTLIB.Scroll);
- }
+ };

EXTLIB.Scroll = function(el, attributes, duration, method) {
if(el){
diff --git a/src/adapter/core/ext-base-anim.js b/src/adapter/core/ext-base-anim.js
index 98bf11c..43112eb 100644
--- a/src/adapter/core/ext-base-anim.js
+++ b/src/adapter/core/ext-base-anim.js
@@ -61,7 +61,7 @@
getAttr: function(attr) {
var el = Ext.fly(this.el),
val = el.getStyle(attr),
- a = offsetAttribute.exec(attr) || []
+ a = offsetAttribute.exec(attr) || [];

if (val !== 'auto' && !offsetUnit.test(val)) {
return parseFloat(val);
diff --git a/src/core/Element.style-more.js b/src/core/Element.style-more.js
index d77c1e0..4a0218c 100644
--- a/src/core/Element.style-more.js
+++ b/src/core/Element.style-more.js
@@ -248,7 +248,7 @@ Ext.Element.addMethods(function(){
return {
width : extdom.getViewWidth(),
height : extdom.getViewHeight()
- }
+ };

// Else use clientHeight/clientWidth
} else {
diff --git a/src/core/Error.js b/src/core/Error.js
index 87c91d8..4c5341a 100644
--- a/src/core/Error.js
+++ b/src/core/Error.js
@@ -49,7 +49,7 @@ function generateError(data) {
Ext.Error = function(message) {
// Try to read the message from Ext.Error.lang
this.message = (this.lang[message]) ? this.lang[message] : message;
-}
+};
Ext.Error.prototype = new Error();
Ext.apply(Ext.Error.prototype, {
// protected. Extensions place their error-strings here.
diff --git a/src/core/core/EventManager.js b/src/core/core/EventManager.js
index 56fd85a..7561a33 100644
--- a/src/core/core/EventManager.js
+++ b/src/core/core/EventManager.js
@@ -510,7 +510,7 @@ Ext.onReady = Ext.EventManager.onDocumentReady;
//Initialize doc classes
(function(){

- var initExtCss = function(){
+ var initExtCss = function() {
// find the body element
var bd = document.body || document.getElementsByTagName('body')[0];
if(!bd){ return false; }
@@ -520,28 +520,28 @@ Ext.onReady = Ext.EventManager.onDocumentReady;
: Ext.isOpera ? "ext-opera"
: Ext.isWebKit ? "ext-webkit" : ""];

- if(Ext.isSafari){
+ if (Ext.isSafari) {
cls.push("ext-safari " + (Ext.isSafari2 ? 'ext-safari2' : (Ext.isSafari3 ? 'ext-safari3' : 'ext-safari4')));
- }else if(Ext.isChrome){
+ } else if (Ext.isChrome) {
cls.push("ext-chrome");
}

- if(Ext.isMac){
+ if (Ext.isMac) {
cls.push("ext-mac");
}
- if(Ext.isLinux){
+ if (Ext.isLinux) {
cls.push("ext-linux");
}

- if(Ext.isStrict || Ext.isBorderBox){ // add to the parent to allow for selectors like ".ext-strict .ext-ie"
+ if (Ext.isStrict || Ext.isBorderBox) { // add to the parent to allow for selectors like ".ext-strict .ext-ie"
var p = bd.parentNode;
- if(p){
+ if (p) {
p.className += Ext.isStrict ? ' ext-strict' : ' ext-border-box';
}
}
bd.className += cls.join(' ');
return true;
- }
+ };

if(!initExtCss()){
Ext.onReady(initExtCss);
diff --git a/src/data/Tree.js b/src/data/Tree.js
index f0c5479..f49b12d 100644
--- a/src/data/Tree.js
+++ b/src/data/Tree.js
@@ -460,7 +460,7 @@ Ext.extend(Ext.data.Node, Ext.util.Observable, {
clear : function(destroy){
// clear any references from the node
this.setOwnerTree(null, destroy);
- this.parentNode = this.previousSibling = this.nextSibling = null
+ this.parentNode = this.previousSibling = this.nextSibling = null;
if(destroy){
this.firstChild = this.lastChild = null;
}
diff --git a/src/data/XmlReader.js b/src/data/XmlReader.js
index d75a37e..6e308fb 100644
--- a/src/data/XmlReader.js
+++ b/src/data/XmlReader.js
@@ -184,7 +184,7 @@ Ext.extend(Ext.data.XmlReader, Ext.data.DataReader, {
}
this.getRoot = function(res) {
return (!Ext.isEmpty(res[this.meta.record])) ? res[this.meta.record] : res[this.meta.root];
- }
+ };
if (s.idPath || s.idProperty) {
var g = this.createAccessor(s.idPath || s.idProperty);
this.getId = function(rec) {
@@ -215,21 +215,21 @@ Ext.extend(Ext.data.XmlReader, Ext.data.DataReader, {
return function(key) {
switch(key) {
case this.meta.totalProperty:
- return function(root, def){
+ return function(root, def) {
return q.selectNumber(key, root, def);
- }
+ };
break;
case this.meta.successProperty:
return function(root, def) {
var sv = q.selectValue(key, root, true);
var success = sv !== false && sv !== 'false';
return success;
- }
+ };
break;
default:
return function(root, def) {
return q.selectValue(key, root, def);
- }
+ };
break;
}
};
diff --git a/src/debug.js b/src/debug.js
index 43f80bf..6be64b6 100644
--- a/src/debug.js
+++ b/src/debug.js
@@ -92,7 +92,7 @@ function createConsole(){
// handleResize();

function handleResize(){
- var b = Ext.getBody()
+ var b = Ext.getBody();
var size = b.getViewSize();
if(size.height < b.dom.scrollHeight) {
size.width -= 18;
@@ -642,7 +642,7 @@ Ext.debug.ObjectInspector = Ext.extend(Ext.tree.TreePanel, {
this.toggleFunc = function() {
this.showFunc = !this.showFunc;
this.refreshNodes(this.currentObject);
- }
+ };
this.bbar = new Ext.Toolbar([{
text: 'Show Functions',
enableToggle: true,
diff --git a/src/direct/Event.js b/src/direct/Event.js
index 503e76c..33e4094 100644
--- a/src/direct/Event.js
+++ b/src/direct/Event.js
@@ -4,9 +4,9 @@
* licensing@extjs.com
* http://www.extjs.com/license
*/
-Ext.Direct.Event = function(config){
+Ext.Direct.Event = function(config) {
Ext.apply(this, config);
-}
+};
Ext.Direct.Event.prototype = {
status: true,
getData: function(){
diff --git a/src/direct/JsonProvider.js b/src/direct/JsonProvider.js
index 412dd73..371caf1 100644
--- a/src/direct/JsonProvider.js
+++ b/src/direct/JsonProvider.js
@@ -29,7 +29,7 @@ Ext.direct.JsonProvider = Ext.extend(Ext.direct.Provider, {
xhr: xhr,
code: Ext.Direct.exceptions.PARSE,
message: 'Error parsing json response: \n\n ' + data
- })
+ });
return [event];
}
var events = [];
diff --git a/src/util/Date.js b/src/util/Date.js
index f28022b..96ef723 100644
--- a/src/util/Date.js
+++ b/src/util/Date.js
@@ -148,18 +148,18 @@ Date.formatCodeToRegex = function(character, currentGroup) {
var p = Date.parseCodes[character];

if (p) {
- p = typeof p == 'function'? p() : p;
+ p = typeof p == 'function' ? p() : p;
Date.parseCodes[character] = p; // reassign function result to prevent repeated execution
}

- return p? Ext.applyIf({
- c: p.c? xf(p.c, currentGroup || "{0}") : p.c
+ return p ? Ext.applyIf({
+ c: p.c ? xf(p.c, currentGroup || "{0}") : p.c
}, p) : {
g:0,
c:null,
s:Ext.escapeRe(character) // treat unrecognised characters as literals
}
-}
+};

// private shorthand for Date.formatCodeToRegex since we'll be using it fairly often
var $f = Date.formatCodeToRegex;
diff --git a/src/util/UpdateManager.js b/src/util/UpdateManager.js
index ab048f1..66a5dbc 100644
--- a/src/util/UpdateManager.js
+++ b/src/util/UpdateManager.js
@@ -359,7 +359,7 @@ function() {
if(Ext.isFunction(url)){
url = url.call(me);
}
- form = Ext.getDom(form)
+ form = Ext.getDom(form);
me.transaction = Ext.Ajax.request({
form: form,
url:url,
diff --git a/src/widgets/PanelDD.js b/src/widgets/PanelDD.js
index 8227642..3c14d40 100644
--- a/src/widgets/PanelDD.js
+++ b/src/widgets/PanelDD.js
@@ -77,7 +77,7 @@ Ext.dd.PanelProxy.prototype = {
show : function(){
if(!this.ghost){
this.ghost = this.panel.createGhost(undefined, undefined, Ext.getBody());
- this.ghost.setXY(this.panel.el.getXY())
+ this.ghost.setXY(this.panel.el.getXY());
if(this.insertProxy){
this.proxy = this.panel.el.insertSibling({cls:'x-panel-dd-spacer'});
this.proxy.setSize(this.panel.getSize());
diff --git a/src/widgets/chart/EventProxy.js b/src/widgets/chart/EventProxy.js
index 9c79f5f..92d1936 100644
--- a/src/widgets/chart/EventProxy.js
+++ b/src/widgets/chart/EventProxy.js
@@ -9,12 +9,12 @@
* @singleton
*/
Ext.FlashEventProxy = {
- onEvent : function(id, e){
+ onEvent : function(id, e) {
var fp = Ext.getCmp(id);
- if(fp){
+ if (fp) {
fp.onFlashEvent(e);
- }else{
+ } else {
arguments.callee.defer(10, this, [id, e]);
}
}
-}
\ No newline at end of file
+};
\ No newline at end of file
diff --git a/src/widgets/form/Form.js b/src/widgets/form/Form.js
index 0cf994f..09ee9cd 100644
--- a/src/widgets/form/Form.js
+++ b/src/widgets/form/Form.js
@@ -275,7 +275,7 @@ Ext.FormPanel = Ext.extend(Ext.Panel, {
}else if(c.findBy){
var isDestroyed = function(o) {
return !!o.isDestroyed;
- }
+ };
this.form.items.filterBy(isDestroyed, this.form).each(this.form.remove, this.form);
}
},
diff --git a/src/widgets/layout/BoxLayout.js b/src/widgets/layout/BoxLayout.js
index f2c4cd7..c25ceaa 100644
--- a/src/widgets/layout/BoxLayout.js
+++ b/src/widgets/layout/BoxLayout.js
@@ -270,7 +270,7 @@ Ext.layout.VBoxLayout = Ext.extend(Ext.layout.BoxLayout, {
cm = c.margins;
t += cm.top;
aw = availableWidth;
- cl = l + cm.left // default left pos
+ cl = l + cm.left; // default left pos

// Adjust left pos for centering
if(this.align == 'center'){
diff --git a/src/widgets/list/ListView.js b/src/widgets/list/ListView.js
index c25bd84..9d41ca2 100644
--- a/src/widgets/list/ListView.js
+++ b/src/widgets/list/ListView.js
@@ -321,7 +321,7 @@ Ext.list.ListView = Ext.extend(Ext.DataView, {
// private
onResize : function(w, h){
var bd = this.innerBody.dom;
- var hd = this.innerHd.dom
+ var hd = this.innerHd.dom;
if(!bd){
return;
}
diff --git a/src/widgets/tree/TreeEventModel.js b/src/widgets/tree/TreeEventModel.js
index 2d8ea42..ed7f230 100644
--- a/src/widgets/tree/TreeEventModel.js
+++ b/src/widgets/tree/TreeEventModel.js
@@ -4,10 +4,10 @@
* licensing@extjs.com
* http://www.extjs.com/license
*/
-Ext.tree.TreeEventModel = function(tree){
+Ext.tree.TreeEventModel = function(tree) {
this.tree = tree;
this.tree.on('render', this.initEvents, this);
-}
+};

Ext.tree.TreeEventModel.prototype = {
initEvents : function(){
--
1.6.6.1

Jamie Avins
8 Feb 2010, 10:19 AM
One of Ed's pet peeves, we'll have these cleaned up for 3.2.0

Jamie Avins
26 Feb 2010, 3:57 PM
Fixed in svn 6179.