flex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From erikdebr...@apache.org
Subject [02/13] git commit: [flex-sdk] [refs/heads/develop] - Fix indentation and code layout
Date Wed, 10 Dec 2014 12:56:08 GMT
Fix indentation and code layout

Signed-off-by: Erik de Bruin <erik@ixsoftware.nl>


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

Branch: refs/heads/develop
Commit: dc7dc4707ea94078c1a4948a5b87c360d705fccd
Parents: f872070
Author: Erik de Bruin <erik@ixsoftware.nl>
Authored: Wed Dec 10 10:33:59 2014 +0100
Committer: Erik de Bruin <erik@ixsoftware.nl>
Committed: Wed Dec 10 13:30:04 2014 +0100

----------------------------------------------------------------------
 .../src/org/apache/flex/promises/Promise.as     | 15 ++++---
 .../flex/promises/interfaces/IThenable.as       |  3 +-
 .../tests/promises/cases/PromisesBasicTests.as  | 42 ++++++++++++++------
 3 files changed, 42 insertions(+), 18 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/dc7dc470/frameworks/projects/apache/src/org/apache/flex/promises/Promise.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/apache/src/org/apache/flex/promises/Promise.as b/frameworks/projects/apache/src/org/apache/flex/promises/Promise.as
index 29ecd08..aacd101 100644
--- a/frameworks/projects/apache/src/org/apache/flex/promises/Promise.as
+++ b/frameworks/projects/apache/src/org/apache/flex/promises/Promise.as
@@ -34,7 +34,8 @@ public class Promise implements IThenable
 	//
 	//--------------------------------------------------------------------------
 	
-	public function Promise(resolver:Function) {
+	public function Promise(resolver:Function) 
+	{
 		handlers_ = new Vector.<Handler>();
 		
 		state_ = PromiseState.PENDING;
@@ -68,7 +69,8 @@ public class Promise implements IThenable
 	//    doResolve_
 	//----------------------------------
 	
-	private function doResolve_(fn:Function, onFulfilled:Function, onRejected:Function):void
+	private function doResolve_(fn:Function, onFulfilled:Function, 
+								onRejected:Function):void
 	{
 		var done:Boolean = false;
 		
@@ -132,12 +134,14 @@ public class Promise implements IThenable
 		}
 		else
 		{
-			if (state_ === PromiseState.FULFILLED && handler.onFulfilled != null)
+			if (state_ === PromiseState.FULFILLED && 
+				handler.onFulfilled != null)
 			{
 				handler.onFulfilled(value_);
 			}
 			
-			if (state_ === PromiseState.REJECTED && handler.onRejected != null)
+			if (state_ === PromiseState.REJECTED && 
+				handler.onRejected != null)
 			{
 				handler.onRejected(value_);
 			}
@@ -178,7 +182,8 @@ public class Promise implements IThenable
 		try 
 		{
 			if (result && 
-				(typeof(result) === 'object' || typeof(result) === 'function') &&
+				(typeof(result) === 'object' || 
+				 typeof(result) === 'function') &&
 				result.then is Function)
 			{
 				doResolve_(result.then, resolve_, reject_);

http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/dc7dc470/frameworks/projects/apache/src/org/apache/flex/promises/interfaces/IThenable.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/apache/src/org/apache/flex/promises/interfaces/IThenable.as
b/frameworks/projects/apache/src/org/apache/flex/promises/interfaces/IThenable.as
index 633cdba..7106179 100644
--- a/frameworks/projects/apache/src/org/apache/flex/promises/interfaces/IThenable.as
+++ b/frameworks/projects/apache/src/org/apache/flex/promises/interfaces/IThenable.as
@@ -23,7 +23,8 @@ package org.apache.flex.promises.interfaces
 public interface IThenable
 {
 
-	function then(onFulfilled:Function = null, onRejected:Function = null):IThenable;
+	function then(onFulfilled:Function = null,
+				  onRejected:Function = null):IThenable;
 	
 }
 

http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/dc7dc470/frameworks/projects/apache/src/tests/promises/cases/PromisesBasicTests.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/apache/src/tests/promises/cases/PromisesBasicTests.as b/frameworks/projects/apache/src/tests/promises/cases/PromisesBasicTests.as
index 4d15250..978795e 100644
--- a/frameworks/projects/apache/src/tests/promises/cases/PromisesBasicTests.as
+++ b/frameworks/projects/apache/src/tests/promises/cases/PromisesBasicTests.as
@@ -229,15 +229,21 @@ public class PromisesBasicTests
 		
 		var anotherStep:Function = function (value:*):IThenable
 		{
-			return new Promise(function (fulfill:Function = null, reject:Function = null):*
+			return new Promise(function (fulfill:Function = null, 
+										 reject:Function = null):*
 			{
-				setTimeout(function ():void { fulfill(value + ' ... again'); }, 10);
+				setTimeout(function ():void { 
+					fulfill(value + ' ... again'); 
+				}, 10);
 			});
 		}
 		
-		promise_ = new Promise(function (fulfill:Function = null, reject:Function = null):*
+		promise_ = new Promise(function (fulfill:Function = null, 
+										 reject:Function = null):*
 		{
-			setTimeout(function ():void { fulfill('Hello world'); }, 10);
+			setTimeout(function ():void { 
+				fulfill('Hello world'); 
+			}, 10);
 		});
 		
 		expected_ = 'Hello world ... again';
@@ -257,15 +263,21 @@ public class PromisesBasicTests
 		
 		var anotherStep:Function = function (value:*):IThenable
 		{
-			return new Promise(function (fulfill:Function = null, reject:Function = null):*
+			return new Promise(function (fulfill:Function = null, 
+										 reject:Function = null):*
 			{
-				setTimeout(function ():void { reject(new Error('reject')); }, 10);
+				setTimeout(function ():void { 
+					reject(new Error('reject')); 
+				}, 10);
 			});
 		}
 		
-		promise_ = new Promise(function (fulfill:Function = null, reject:Function = null):*
+		promise_ = new Promise(function (fulfill:Function = null, 
+										 reject:Function = null):*
 		{
-			setTimeout(function ():void { fulfill('Hello world'); }, 10);
+			setTimeout(function ():void { 
+				fulfill('Hello world'); 
+			}, 10);
 		});
 		
 		expected_ = 'Error: reject';
@@ -285,15 +297,21 @@ public class PromisesBasicTests
 		
 		var anotherStep:Function = function (value:*):IThenable
 		{
-			return new Promise(function (fulfill:Function = null, reject:Function = null):*
+			return new Promise(function (fulfill:Function = null, 
+										 reject:Function = null):*
 			{
-				setTimeout(function ():void { fulfill(value + ' ... again'); }, 10);
+				setTimeout(function ():void { 
+					fulfill(value + ' ... again'); 
+				}, 10);
 			});
 		}
 		
-		promise_ = new Promise(function (fulfill:Function = null, reject:Function = null):*
+		promise_ = new Promise(function (fulfill:Function = null, 
+										 reject:Function = null):*
 		{
-			setTimeout(function ():void { reject(new Error('reject')); }, 10);
+			setTimeout(function ():void { 
+				reject(new Error('reject')); 
+			}, 10);
 		});
 		
 		expected_ = 'Error: reject';


Mime
View raw message