You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flex.apache.org by ah...@apache.org on 2014/11/11 23:08:43 UTC

[27/28] git commit: [flex-asjs] [refs/heads/develop] - lint

lint


Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/04703847
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/04703847
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/04703847

Branch: refs/heads/develop
Commit: 047038475b169efd0118dbaf97106855ed9711d7
Parents: ee19130
Author: Alex Harui <ah...@apache.org>
Authored: Mon Nov 10 11:29:23 2014 -0800
Committer: Alex Harui <ah...@apache.org>
Committed: Tue Nov 11 14:08:00 2014 -0800

----------------------------------------------------------------------
 frameworks/js/FlexJS/src/mx/states/AddItems.js  |  6 ++--
 .../src/org/apache/flex/core/CallLaterBead.js   | 12 +++----
 .../org/apache/flex/core/SimpleStatesImpl.js    | 15 ++++----
 .../org/apache/flex/effects/PlatformWiper.js    | 16 ++++-----
 .../src/org/apache/flex/events/DragEvent.js     |  6 ++--
 .../js/FlexJS/src/org/apache/flex/geom/Point.js | 18 +++++-----
 .../src/org/apache/flex/geom/Rectangle.js       | 36 +++++++++++---------
 .../src/org/apache/flex/html/HContainer.js      |  2 +-
 .../org/apache/flex/html/ImageAndTextButton.js  | 10 ++----
 .../org/apache/flex/html/ToggleTextButton.js    | 27 ++++++++-------
 .../src/org/apache/flex/html/VContainer.js      |  2 +-
 .../src/org/apache/flex/utils/PointUtils.js     |  8 ++---
 12 files changed, 81 insertions(+), 77 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/04703847/frameworks/js/FlexJS/src/mx/states/AddItems.js
----------------------------------------------------------------------
diff --git a/frameworks/js/FlexJS/src/mx/states/AddItems.js b/frameworks/js/FlexJS/src/mx/states/AddItems.js
index 31cd682..a8bac93 100644
--- a/frameworks/js/FlexJS/src/mx/states/AddItems.js
+++ b/frameworks/js/FlexJS/src/mx/states/AddItems.js
@@ -46,7 +46,7 @@ mx.states.AddItems.prototype.setDocument = function(document, opt_id) {
   this.document = document;
   var data = document.mxmlsd[itemsDescriptorIndex];
   if (typeof(data.slice) == 'function') {
-  	itemsDescriptor = {};
+    itemsDescriptor = {};
     itemsDescriptor.descriptor = data;
     // replace the entry in the document so subsequent
     // addItems know it is shared
@@ -72,10 +72,10 @@ mx.states.AddItems.prototype.items = null;
 
 /**
  * @expose
- * @type {Array} itemsDescriptor The index into the array 
+ * @type {number} itemsDescriptor The index into the array
  *                               of itemDescriptors on the document
  */
-mx.states.AddItems.prototype.itemsDescriptorIndex;
+mx.states.AddItems.prototype.itemsDescriptorIndex = -1;
 
 
 /**

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/04703847/frameworks/js/FlexJS/src/org/apache/flex/core/CallLaterBead.js
----------------------------------------------------------------------
diff --git a/frameworks/js/FlexJS/src/org/apache/flex/core/CallLaterBead.js b/frameworks/js/FlexJS/src/org/apache/flex/core/CallLaterBead.js
index c36af25..d2f2003 100644
--- a/frameworks/js/FlexJS/src/org/apache/flex/core/CallLaterBead.js
+++ b/frameworks/js/FlexJS/src/org/apache/flex/core/CallLaterBead.js
@@ -28,7 +28,7 @@ org.apache.flex.core.CallLaterBead = function() {
   this.strand_ = null;
 
   /**
-   * @protected
+   * @private
    * @type {Array}
    */
   this.calls_ = null;
@@ -61,16 +61,16 @@ org.apache.flex.core.CallLaterBead.prototype.set_strand =
 /**
  * @protected
  * @param {Function} fn The fucntion to call later.
- * @param {Array=} args The optional array of arguments.
- * @param {Object} thisArg The optional 'this' object.
+ * @param {Array=} opt_args The optional array of arguments.
+ * @param {Object=} opt_thisArg The optional 'this' object.
  */
 org.apache.flex.core.CallLaterBead.prototype.callLater =
-    function(fn, args, thisArg) {
+    function(fn, opt_args, opt_thisArg) {
 
   if (this.calls_ == null)
-	this.calls_ = [ {thisArg: thisArg, fn: fn, args: args } ];
+    this.calls_ = [{thisArg: opt_thisArg, fn: fn, args: opt_args }];
   else
-    this.calls_.push({thisArg: thisArg, fn: fn, args: args });
+    this.calls_.push({thisArg: opt_thisArg, fn: fn, args: opt_args });
 
   window.setTimeout(callback, 0);
 };

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/04703847/frameworks/js/FlexJS/src/org/apache/flex/core/SimpleStatesImpl.js
----------------------------------------------------------------------
diff --git a/frameworks/js/FlexJS/src/org/apache/flex/core/SimpleStatesImpl.js b/frameworks/js/FlexJS/src/org/apache/flex/core/SimpleStatesImpl.js
index 6a1d99c..b5bd91f 100644
--- a/frameworks/js/FlexJS/src/org/apache/flex/core/SimpleStatesImpl.js
+++ b/frameworks/js/FlexJS/src/org/apache/flex/core/SimpleStatesImpl.js
@@ -15,8 +15,8 @@
 goog.provide('org.apache.flex.core.SimpleStatesImpl');
 
 goog.require('mx.states.AddItems');
-goog.require('mx.states.SetProperty');
 goog.require('mx.states.SetEventHandler');
+goog.require('mx.states.SetProperty');
 goog.require('mx.states.State');
 goog.require('org.apache.flex.core.IBead');
 goog.require('org.apache.flex.core.IStatesImpl');
@@ -183,14 +183,13 @@ org.apache.flex.core.SimpleStatesImpl.prototype.apply_ = function(s) {
     o = arr[p];
     if (org.apache.flex.utils.Language.is(o, mx.states.AddItems)) {
       if (!o.items) {
-      	o.items = o.itemsDescriptor.items;
-        if (o.items == null)
-        {
-        	ai.items = 
-            	MXMLDataInterpreter.generateMXMLArray(o.document,
+        o.items = o.itemsDescriptor.items;
+        if (o.items == null) {
+          ai.items =
+              MXMLDataInterpreter.generateMXMLArray(o.document,
                                     null, ai.itemsDescriptor.descriptor);
-            o.itemsDescriptor.items = ai.items;
-         }
+          o.itemsDescriptor.items = ai.items;
+        }
       }
 
       for (q in o.items) {

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/04703847/frameworks/js/FlexJS/src/org/apache/flex/effects/PlatformWiper.js
----------------------------------------------------------------------
diff --git a/frameworks/js/FlexJS/src/org/apache/flex/effects/PlatformWiper.js b/frameworks/js/FlexJS/src/org/apache/flex/effects/PlatformWiper.js
index 369f2e4..3b48370 100644
--- a/frameworks/js/FlexJS/src/org/apache/flex/effects/PlatformWiper.js
+++ b/frameworks/js/FlexJS/src/org/apache/flex/effects/PlatformWiper.js
@@ -21,13 +21,13 @@ goog.require('org.apache.flex.geom.Rectangle');
 /**
  * @constructor
  */
-org.apache.flex.effects.PlatformWiper = function(delay, opt_repeatCount) {
+org.apache.flex.effects.PlatformWiper = function() {
 
   /**
-   * @protected
+   * @private
    * @type {Object}
    */
-  this.target_;
+  this.target_ = null;
 
 };
 
@@ -47,10 +47,10 @@ org.apache.flex.effects.PlatformWiper.prototype.FLEXJS_CLASS_INFO =
  * Sets the target for the Wipe.
  * @param {Object} target The target for the Wipe effect.
  */
-org.apache.flex.effects.PlatformWiper.prototype.set_target = 
-	function(target) {
+org.apache.flex.effects.PlatformWiper.prototype.set_target =
+    function(target) {
   if (target == null)
-  	delete this.target_.style.clip;
+      delete this.target_.style.clip;
   this.target_ = target;
 };
 
@@ -60,8 +60,8 @@ org.apache.flex.effects.PlatformWiper.prototype.set_target =
  * Clips the Object.
  * @param {org.apache.flex.geom.Rectangle} rect The visible area.
  */
-org.apache.flex.effects.PlatformWiper.prototype.set_visibleRect = 
-	function(rect) {
+org.apache.flex.effects.PlatformWiper.prototype.set_visibleRect =
+    function(rect) {
   var styleString = 'rect(';
   styleString += rect.top.toString() + 'px,';
   styleString += rect.width.toString() + 'px,';

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/04703847/frameworks/js/FlexJS/src/org/apache/flex/events/DragEvent.js
----------------------------------------------------------------------
diff --git a/frameworks/js/FlexJS/src/org/apache/flex/events/DragEvent.js b/frameworks/js/FlexJS/src/org/apache/flex/events/DragEvent.js
index 705b531..34395e4 100644
--- a/frameworks/js/FlexJS/src/org/apache/flex/events/DragEvent.js
+++ b/frameworks/js/FlexJS/src/org/apache/flex/events/DragEvent.js
@@ -71,9 +71,9 @@ org.apache.flex.events.DragEvent.prototype.dragSource = null;
  * @expose
  * @param {MouseEvent} event The mouse event to copy.
  */
-org.apache.flex.events.DragEvent.prototype.copyMouseEventProperties = 
-	function(event) {
-}
+org.apache.flex.events.DragEvent.prototype.copyMouseEventProperties =
+    function(event) {
+};
 
 
 /**

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/04703847/frameworks/js/FlexJS/src/org/apache/flex/geom/Point.js
----------------------------------------------------------------------
diff --git a/frameworks/js/FlexJS/src/org/apache/flex/geom/Point.js b/frameworks/js/FlexJS/src/org/apache/flex/geom/Point.js
index c6e183c..febb4dd 100644
--- a/frameworks/js/FlexJS/src/org/apache/flex/geom/Point.js
+++ b/frameworks/js/FlexJS/src/org/apache/flex/geom/Point.js
@@ -18,6 +18,8 @@ goog.provide('org.apache.flex.geom.Point');
 
 /**
  * @constructor
+ * @param {number} x
+ * @param {number} y
  */
 org.apache.flex.geom.Point = function(x, y) {
 
@@ -51,8 +53,8 @@ org.apache.flex.geom.Point.prototype.FLEXJS_CLASS_INFO =
  * The x coordinate.
  * @return {number} value The x coordinate.
  */
-org.apache.flex.geom.Point.prototype.get_x = 
-	function() {
+org.apache.flex.geom.Point.prototype.get_x =
+    function() {
   return this.x;
 };
 
@@ -62,8 +64,8 @@ org.apache.flex.geom.Point.prototype.get_x =
  * The x coordinate.
  * @param {number} value The x coordinate.
  */
-org.apache.flex.geom.Point.prototype.set_x = 
-	function(value) {
+org.apache.flex.geom.Point.prototype.set_x =
+    function(value) {
   this.x = value;
 };
 
@@ -73,8 +75,8 @@ org.apache.flex.geom.Point.prototype.set_x =
  * The y coordinate.
  * @return {number} value The y coordinate.
  */
-org.apache.flex.geom.Point.prototype.get_y = 
-	function() {
+org.apache.flex.geom.Point.prototype.get_y =
+    function() {
   return this.y;
 };
 
@@ -84,7 +86,7 @@ org.apache.flex.geom.Point.prototype.get_y =
  * The y coordinate.
  * @param {number} value The y coordinate.
  */
-org.apache.flex.geom.Point.prototype.set_y = 
-	function(value) {
+org.apache.flex.geom.Point.prototype.set_y =
+    function(value) {
   this.y = value;
 };

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/04703847/frameworks/js/FlexJS/src/org/apache/flex/geom/Rectangle.js
----------------------------------------------------------------------
diff --git a/frameworks/js/FlexJS/src/org/apache/flex/geom/Rectangle.js b/frameworks/js/FlexJS/src/org/apache/flex/geom/Rectangle.js
index 9bd82a8..32f126c 100644
--- a/frameworks/js/FlexJS/src/org/apache/flex/geom/Rectangle.js
+++ b/frameworks/js/FlexJS/src/org/apache/flex/geom/Rectangle.js
@@ -18,6 +18,10 @@ goog.provide('org.apache.flex.geom.Rectangle');
 
 /**
  * @constructor
+ * @param {number} left
+ * @param {number} top
+ * @param {number} width
+ * @param {number} height
  */
 org.apache.flex.geom.Rectangle = function(left, top, width, height) {
 
@@ -63,8 +67,8 @@ org.apache.flex.geom.Rectangle.prototype.FLEXJS_CLASS_INFO =
  * The left coordinate.
  * @return {number} value The left coordinate.
  */
-org.apache.flex.geom.Rectangle.prototype.get_left = 
-	function() {
+org.apache.flex.geom.Rectangle.prototype.get_left =
+    function() {
   return this.left;
 };
 
@@ -74,8 +78,8 @@ org.apache.flex.geom.Rectangle.prototype.get_left =
  * The left coordinate.
  * @param {number} value The left coordinate.
  */
-org.apache.flex.geom.Rectangle.prototype.set_left = 
-	function(value) {
+org.apache.flex.geom.Rectangle.prototype.set_left =
+    function(value) {
   this.left = value;
 };
 
@@ -85,8 +89,8 @@ org.apache.flex.geom.Rectangle.prototype.set_left =
  * The top coordinate.
  * @return {number} value The top coordinate.
  */
-org.apache.flex.geom.Rectangle.prototype.get_top = 
-	function() {
+org.apache.flex.geom.Rectangle.prototype.get_top =
+    function() {
   return this.top;
 };
 
@@ -96,8 +100,8 @@ org.apache.flex.geom.Rectangle.prototype.get_top =
  * The top coordinate.
  * @param {number} value The top coordinate.
  */
-org.apache.flex.geom.Rectangle.prototype.set_top = 
-	function(value) {
+org.apache.flex.geom.Rectangle.prototype.set_top =
+    function(value) {
   this.top = value;
 };
 
@@ -107,8 +111,8 @@ org.apache.flex.geom.Rectangle.prototype.set_top =
  * The width coordinate.
  * @return {number} value The width coordinate.
  */
-org.apache.flex.geom.Rectangle.prototype.get_width = 
-	function() {
+org.apache.flex.geom.Rectangle.prototype.get_width =
+    function() {
   return this.width;
 };
 
@@ -118,8 +122,8 @@ org.apache.flex.geom.Rectangle.prototype.get_width =
  * The width coordinate.
  * @param {number} value The width coordinate.
  */
-org.apache.flex.geom.Rectangle.prototype.set_width = 
-	function(value) {
+org.apache.flex.geom.Rectangle.prototype.set_width =
+    function(value) {
   this.width = value;
 };
 
@@ -129,8 +133,8 @@ org.apache.flex.geom.Rectangle.prototype.set_width =
  * The height coordinate.
  * @return {number} value The height coordinate.
  */
-org.apache.flex.geom.Rectangle.prototype.get_height = 
-	function() {
+org.apache.flex.geom.Rectangle.prototype.get_height =
+    function() {
   return this.height;
 };
 
@@ -140,8 +144,8 @@ org.apache.flex.geom.Rectangle.prototype.get_height =
  * The height coordinate.
  * @param {number} value The height coordinate.
  */
-org.apache.flex.geom.Rectangle.prototype.set_height = 
-	function(value) {
+org.apache.flex.geom.Rectangle.prototype.set_height =
+    function(value) {
   this.height = value;
 };
 

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/04703847/frameworks/js/FlexJS/src/org/apache/flex/html/HContainer.js
----------------------------------------------------------------------
diff --git a/frameworks/js/FlexJS/src/org/apache/flex/html/HContainer.js b/frameworks/js/FlexJS/src/org/apache/flex/html/HContainer.js
index 4e24093..f00c395 100644
--- a/frameworks/js/FlexJS/src/org/apache/flex/html/HContainer.js
+++ b/frameworks/js/FlexJS/src/org/apache/flex/html/HContainer.js
@@ -14,8 +14,8 @@
 
 goog.provide('org.apache.flex.html.HContainer');
 
-goog.require('org.apache.flex.html.Container');
 goog.require('org.apache.flex.core.IContainer');
+goog.require('org.apache.flex.html.Container');
 
 
 

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/04703847/frameworks/js/FlexJS/src/org/apache/flex/html/ImageAndTextButton.js
----------------------------------------------------------------------
diff --git a/frameworks/js/FlexJS/src/org/apache/flex/html/ImageAndTextButton.js b/frameworks/js/FlexJS/src/org/apache/flex/html/ImageAndTextButton.js
index 2d1efa8..e33eae4 100644
--- a/frameworks/js/FlexJS/src/org/apache/flex/html/ImageAndTextButton.js
+++ b/frameworks/js/FlexJS/src/org/apache/flex/html/ImageAndTextButton.js
@@ -24,12 +24,8 @@ goog.require('org.apache.flex.html.Button');
  */
 org.apache.flex.html.ImageAndTextButton = function() {
   org.apache.flex.html.ImageAndTextButton.base(this, 'constructor');
-  
-  /**
-   * @type {Object>}
-   */
-  this.img;
-  
+
+
 };
 goog.inherits(org.apache.flex.html.ImageAndTextButton,
     org.apache.flex.html.Button);
@@ -54,7 +50,7 @@ org.apache.flex.html.ImageAndTextButton.prototype.createElement =
   this.element.setAttribute('type', 'button');
   this.img = document.createElement('img');
   this.element.appendChild(img);
-  
+
   this.positioner = this.element;
   this.element.flexjs_wrapper = this;
 

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/04703847/frameworks/js/FlexJS/src/org/apache/flex/html/ToggleTextButton.js
----------------------------------------------------------------------
diff --git a/frameworks/js/FlexJS/src/org/apache/flex/html/ToggleTextButton.js b/frameworks/js/FlexJS/src/org/apache/flex/html/ToggleTextButton.js
index 281b144..065df45 100644
--- a/frameworks/js/FlexJS/src/org/apache/flex/html/ToggleTextButton.js
+++ b/frameworks/js/FlexJS/src/org/apache/flex/html/ToggleTextButton.js
@@ -28,6 +28,7 @@ org.apache.flex.html.ToggleTextButton = function() {
 
 
   /**
+   * @private
    * @type {boolean}
    */
   this.selected_ = false;
@@ -64,6 +65,7 @@ org.apache.flex.html.ToggleTextButton.prototype.set_text =
   this.element.innerHTML = value;
 };
 
+
 /**
  * @expose
  * @return {boolean} The selected getter.
@@ -73,6 +75,7 @@ org.apache.flex.html.ToggleTextButton.prototype.get_selected =
   return this.selected_;
 };
 
+
 /**
  * @expose
  * @param {boolean} value The selected setter.
@@ -80,17 +83,17 @@ org.apache.flex.html.ToggleTextButton.prototype.get_selected =
 org.apache.flex.html.ToggleTextButton.prototype.set_selected =
     function(value) {
   if (this.selected_ != value) {
-	this.selected_ = value;
-	
-	var className = this._strand.className;
-	if (value) {
-		if (className.indexOf(this.SELECTED) == className.length - this.SELECTED.length)
-			this._strand.className = className.substring(0, className.length - this.SELECTED.length);
-	}
-	else {
-		if (className.indexOf(this.SELECTED) == -1)
-			this._strand.className += this.SELECTED;
-	}
+    this.selected_ = value;
+
+    var className = this._strand.className;
+    if (value) {
+      if (className.indexOf(this.SELECTED) == className.length - this.SELECTED.length)
+        this._strand.className = className.substring(0, className.length - this.SELECTED.length);
+    }
+    else {
+      if (className.indexOf(this.SELECTED) == -1)
+        this._strand.className += this.SELECTED;
+    }
 
   }
 };
@@ -99,5 +102,5 @@ org.apache.flex.html.ToggleTextButton.prototype.set_selected =
 /**
  * @type {string} The selected setter.
  */
-org.apache.flex.html.ToggleTextButton.prototype.SELECTED = "_Selected";
+org.apache.flex.html.ToggleTextButton.prototype.SELECTED = '_Selected';
 

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/04703847/frameworks/js/FlexJS/src/org/apache/flex/html/VContainer.js
----------------------------------------------------------------------
diff --git a/frameworks/js/FlexJS/src/org/apache/flex/html/VContainer.js b/frameworks/js/FlexJS/src/org/apache/flex/html/VContainer.js
index bedd53b..8d646a0 100644
--- a/frameworks/js/FlexJS/src/org/apache/flex/html/VContainer.js
+++ b/frameworks/js/FlexJS/src/org/apache/flex/html/VContainer.js
@@ -14,8 +14,8 @@
 
 goog.provide('org.apache.flex.html.VContainer');
 
-goog.require('org.apache.flex.html.Container');
 goog.require('org.apache.flex.core.IContainer');
+goog.require('org.apache.flex.html.Container');
 
 
 

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/04703847/frameworks/js/FlexJS/src/org/apache/flex/utils/PointUtils.js
----------------------------------------------------------------------
diff --git a/frameworks/js/FlexJS/src/org/apache/flex/utils/PointUtils.js b/frameworks/js/FlexJS/src/org/apache/flex/utils/PointUtils.js
index a5a8f8c..e18aa71 100644
--- a/frameworks/js/FlexJS/src/org/apache/flex/utils/PointUtils.js
+++ b/frameworks/js/FlexJS/src/org/apache/flex/utils/PointUtils.js
@@ -49,10 +49,10 @@ org.apache.flex.utils.PointUtils.globalToLocal =
   do {
     x -= element.offsetLeft;
     y -= element.offsetTop;
-	element = element.offsetParent;
+    element = element.offsetParent;
   }
   while (element);
-  return new Point(x,y);
+  return new Point(x, y);
 };
 
 
@@ -70,8 +70,8 @@ org.apache.flex.utils.PointUtils.localToGlobal =
   do {
     x += element.offsetLeft;
     y += element.offsetTop;
-	element = element.offsetParent;
+    element = element.offsetParent;
   }
   while (element);
-  return new Point(x,y);
+  return new Point(x, y);
 };