You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@royale.apache.org by ah...@apache.org on 2018/12/27 01:54:51 UTC

[royale-asjs] branch develop updated (5e017a3 -> 4ba958c)

This is an automated email from the ASF dual-hosted git repository.

aharui pushed a change to branch develop
in repository https://gitbox.apache.org/repos/asf/royale-asjs.git.


    from 5e017a3  committed this file by mistake
     new 9240cac  upgrade to Closure Library 20180910
     new 4ba958c  fix warnings and errors in these files

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 frameworks/downloads.xml                           |  2 +-
 .../apache/royale/storage/file/DataInputStream.as  |  2 +-
 .../apache/royale/storage/file/DataOutputStream.as | 21 +++++-
 .../providers/AndroidExternalStorageProvider.as    | 78 +++++++++++++++------
 .../royale/storage/providers/WebStorageProvider.as | 80 ++++++++++++++++------
 5 files changed, 137 insertions(+), 46 deletions(-)


[royale-asjs] 01/02: upgrade to Closure Library 20180910

Posted by ah...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

aharui pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/royale-asjs.git

commit 9240cac14ce92cd1bbec95c56180c03a455964ee
Author: Alex Harui <ah...@apache.org>
AuthorDate: Wed Dec 26 17:50:31 2018 -0800

    upgrade to Closure Library 20180910
---
 frameworks/downloads.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/frameworks/downloads.xml b/frameworks/downloads.xml
index 5ba50bf..66dc783 100644
--- a/frameworks/downloads.xml
+++ b/frameworks/downloads.xml
@@ -262,7 +262,7 @@
 	<!-- Google Closure Library -->
     <target name="gcl-download" depends="check-goog-home" unless="GOOG_HOME" description="Downloads Google Closure Library">
     	<mkdir dir="${download.dir}"/>
-    	<get src="https://github.com/google/closure-library/archive/v20170910.zip"
+    	<get src="https://github.com/google/closure-library/archive/v20180910.zip"
     	        dest="${download.dir}/google-closure-library-master.zip"
     	        verbose="false" ignoreerrors="true"/>
     	


[royale-asjs] 02/02: fix warnings and errors in these files

Posted by ah...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

aharui pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/royale-asjs.git

commit 4ba958cc896c244467fad3d213ecbe4893d0e0a9
Author: Alex Harui <ah...@apache.org>
AuthorDate: Wed Dec 26 17:50:57 2018 -0800

    fix warnings and errors in these files
---
 .../apache/royale/storage/file/DataInputStream.as  |  2 +-
 .../apache/royale/storage/file/DataOutputStream.as | 21 +++++-
 .../providers/AndroidExternalStorageProvider.as    | 78 +++++++++++++++------
 .../royale/storage/providers/WebStorageProvider.as | 80 ++++++++++++++++------
 4 files changed, 136 insertions(+), 45 deletions(-)

diff --git a/frameworks/projects/Storage/src/main/royale/org/apache/royale/storage/file/DataInputStream.as b/frameworks/projects/Storage/src/main/royale/org/apache/royale/storage/file/DataInputStream.as
index 695a34e..ef0ce54 100644
--- a/frameworks/projects/Storage/src/main/royale/org/apache/royale/storage/file/DataInputStream.as
+++ b/frameworks/projects/Storage/src/main/royale/org/apache/royale/storage/file/DataInputStream.as
@@ -67,7 +67,7 @@ public class DataInputStream extends EventDispatcher implements IDataInput
 			
 			var self:DataInputStream = this;
 			
-			_fileReader.onloadend = function (e):void {
+			_fileReader.onloadend = function (e:Event):void {
 				var streamEvent:FileEvent = new FileEvent("READ");
 				streamEvent.stream = self;
 				streamEvent.data = this.result;
diff --git a/frameworks/projects/Storage/src/main/royale/org/apache/royale/storage/file/DataOutputStream.as b/frameworks/projects/Storage/src/main/royale/org/apache/royale/storage/file/DataOutputStream.as
index 55eab71..f475ade 100644
--- a/frameworks/projects/Storage/src/main/royale/org/apache/royale/storage/file/DataOutputStream.as
+++ b/frameworks/projects/Storage/src/main/royale/org/apache/royale/storage/file/DataOutputStream.as
@@ -67,13 +67,13 @@ public class DataOutputStream extends EventDispatcher implements IDataOutput
 			
 			var self:DataOutputStream = this;
 			
-			_fileWriter.onwriteend = function (e):void {
+			_fileWriter.onwriteend = function (e:Event):void {
 				var newEvent:FileEvent = new FileEvent("WRITE");
 				newEvent.stream = self;
 				_target.dispatchEvent(newEvent);
 			};
 			
-			_fileWriter.onerror = function (e):void {
+			_fileWriter.onerror = function (e:Event):void {
 				var newEvent:FileErrorEvent = new FileErrorEvent("ERROR");
 				newEvent.stream = self;
 				newEvent.errorMessage = "Failed to write the file.";
@@ -117,7 +117,7 @@ public class DataOutputStream extends EventDispatcher implements IDataOutput
 	public function writeText(text:String):void
 	{
 		COMPILE::JS {
-			var blob:Blob = new Blob([text], { type: 'text/plain' } as BlobPropertyBag);
+			var blob:Blob = new Blob([text], new BlobPlainTextOptions());
 			_fileWriter.write(blob);
 		}
 		COMPILE::SWF {
@@ -163,3 +163,18 @@ public class DataOutputStream extends EventDispatcher implements IDataOutput
 }
 
 }
+
+COMPILE::JS
+class BlobPlainTextOptions implements BlobPropertyBag
+{
+    public function get type():String
+    {
+        return "text/plain";
+    }
+    
+    public function set type(value:String):void
+    {
+        
+    }
+}
+
diff --git a/frameworks/projects/Storage/src/main/royale/org/apache/royale/storage/providers/AndroidExternalStorageProvider.as b/frameworks/projects/Storage/src/main/royale/org/apache/royale/storage/providers/AndroidExternalStorageProvider.as
index cf05a73..22f9be9 100644
--- a/frameworks/projects/Storage/src/main/royale/org/apache/royale/storage/providers/AndroidExternalStorageProvider.as
+++ b/frameworks/projects/Storage/src/main/royale/org/apache/royale/storage/providers/AndroidExternalStorageProvider.as
@@ -98,10 +98,10 @@ package org.apache.royale.storage.providers
 			COMPILE::JS {
 				var fullPath:String = String(cordova["file"]["dataDirectory"]) + fileName;
 				
-				window.resolveLocalFileSystemURL(fullPath, function (fileEntry):void {
-					fileEntry.file(function (file):void {
+				window.resolveLocalFileSystemURL(fullPath, function (fileEntry:FileEntry):void {
+					fileEntry.file(function (file:File):void {
 						var reader:FileReader = new FileReader();
-						reader.onloadend = function (e):void {
+						reader.onloadend = function (e:Event):void {
 							var newEvent:FileEvent = new FileEvent("READ");
 							newEvent.data = this.result;
 							_target.dispatchEvent(newEvent);
@@ -110,13 +110,13 @@ package org.apache.royale.storage.providers
 							_target.dispatchEvent(finEvent);
 						};
 						reader.readAsText(file);
-					}, function (e):void {
+					}, function (e:Event):void {
 						var err1Event:FileErrorEvent = new FileErrorEvent("ERROR");
 						err1Event.errorMessage = "Cannot open file for reading";
 						err1Event.errorCode = 2;
 						_target.dispatchEvent(err1Event);
 					});
-				}, function (e):void {
+				}, function (e:Event):void {
 					var err2Event:FileErrorEvent = new FileErrorEvent("ERROR");
 					err2Event.errorMessage = "File does not exist";
 					err2Event.errorCode = 1;
@@ -142,19 +142,19 @@ package org.apache.royale.storage.providers
 			COMPILE::JS {
 				var fullPath:String = String(cordova["file"]["dataDirectory"]) + fileName;
 				
-				window.resolveLocalFileSystemURL(fullPath, function (fileEntry):void {
-					fileEntry.file(function (file):void {
+				window.resolveLocalFileSystemURL(fullPath, function (fileEntry:FileEntry):void {
+					fileEntry.file(function (file:File):void {
 						var inputStream:DataInputStream = new DataInputStream(_target, file, new FileReader());
 						var newEvent:FileEvent = new FileEvent("READY");
 						newEvent.stream = inputStream;
 						_target.dispatchEvent(newEvent);
-					}, function (e):void {
+					}, function (e:Event):void {
 						var err1Event:FileErrorEvent = new FileErrorEvent("ERROR");
 						err1Event.errorMessage = "Cannot open file for reading";
 						err1Event.errorCode = 2;
 						_target.dispatchEvent(err1Event);
 					});
-				}, function (e):void {
+				}, function (e:Event):void {
 					var err2Event:FileErrorEvent = new FileErrorEvent("ERROR");
 					err2Event.errorMessage = "File does not exist";
 					err2Event.errorCode = 1;
@@ -182,9 +182,9 @@ package org.apache.royale.storage.providers
 			COMPILE::JS {
 				var fullPath:String = String(cordova["file"]["dataDirectory"]) + fileName;
 		
-				window.resolveLocalFileSystemURL(fullPath, function (fileEntry):void {
-						fileEntry.createWriter(function (fileWriter):void {
-							fileWriter.onwriteend = function (e):void {
+				window.resolveLocalFileSystemURL(fullPath, function (fileEntry:FileEntry):void {
+						fileEntry.createWriter(function (fileWriter:FileWriter):void {
+							fileWriter.onwriteend = function (e:Event):void {
 								var newEvent:FileEvent = new FileEvent("WRITE");
 								_target.dispatchEvent(newEvent);
 								
@@ -192,22 +192,22 @@ package org.apache.royale.storage.providers
 								_target.dispatchEvent(finEvent);
 							};
 							
-							fileWriter.onerror = function (e):void {
+							fileWriter.onerror = function (e:Event):void {
 								var newEvent:FileErrorEvent = new FileErrorEvent("ERROR");
 								newEvent.errorMessage = "Failed to write the file.";
 								newEvent.errorCode = 3;
 								_target.dispatchEvent(newEvent);
 							};
 							
-							var blob:Blob = new Blob([text], { type: 'text/plain' } as BlobPropertyBag);
+							var blob:Blob = new Blob([text], new BlobPlainTextOptions());
 							fileWriter.write(blob);
-						}, function(e):void {
+						}, function(e:Event):void {
 							var errEvent:FileErrorEvent = new FileErrorEvent("ERROR");
 							errEvent.errorMessage = "Cannot open file for writing.";
 							errEvent.errorCode = 1;
 							_target.dispatchEvent(errEvent);
 						});
-					}, function(e):void {
+					}, function(e:Event):void {
 						var errEvent:FileErrorEvent = new FileErrorEvent("ERROR");
 						errEvent.errorMessage = "Cannot create file.";
 						errEvent.errorCode = 4;
@@ -233,9 +233,9 @@ package org.apache.royale.storage.providers
 			COMPILE::JS {
 				var fullPath:String = String(cordova["file"]["dataDirectory"]) + fileName;
 				
-				window.resolveLocalFileSystemURL(fullPath, function (directoryEntry):void {
-					directoryEntry.getFile(fileName, { 'create': true }, function (fileEntry):void {
-						fileEntry.createWriter(function (fileWriter):void {
+				window.resolveLocalFileSystemURL(fullPath, function (directoryEntry:DirectoryEntry):void {
+					directoryEntry.getFile(fileName, new FileSystemCreateFlags, function (fileEntry:FileEntry):void {
+						fileEntry.createWriter(function (fileWriter:FileWriter):void {
 							var outputStream:DataOutputStream = new DataOutputStream(_target, fileEntry, fileWriter);
 							var newEvent:FileEvent = new FileEvent("READY");
 							newEvent.stream = outputStream;
@@ -245,5 +245,43 @@ package org.apache.royale.storage.providers
 				});
 			}
 		}
-	}
+	}    
+}
+
+COMPILE::JS
+class BlobPlainTextOptions implements BlobPropertyBag
+{
+    public function get type():String
+    {
+        return "text/plain";
+    }
+    
+    public function set type(value:String):void
+    {
+        
+    }
+}
+
+COMPILE::JS
+class FileSystemCreateFlags implements FileSystemFlags
+{
+    public function get create():Boolean
+    {
+        return true;
+    }
+    
+    public function set create(value:Boolean):void
+    {
+        
+    }
+    
+    public function get exclusive():Boolean
+    {
+        return false;
+    }
+    
+    public function set exclusive(value:Boolean):void
+    {
+        
+    }
 }
diff --git a/frameworks/projects/Storage/src/main/royale/org/apache/royale/storage/providers/WebStorageProvider.as b/frameworks/projects/Storage/src/main/royale/org/apache/royale/storage/providers/WebStorageProvider.as
index dd9c84c..cf0d2ec 100644
--- a/frameworks/projects/Storage/src/main/royale/org/apache/royale/storage/providers/WebStorageProvider.as
+++ b/frameworks/projects/Storage/src/main/royale/org/apache/royale/storage/providers/WebStorageProvider.as
@@ -97,10 +97,10 @@ package org.apache.royale.storage.providers
 			COMPILE::JS {
 				var fullPath:String = String(cordova["file"]["dataDirectory"]) + fileName;
 				
-				window.resolveLocalFileSystemURL(fullPath, function (fileEntry):void {
-					fileEntry.file(function (file):void {
+				window.resolveLocalFileSystemURL(fullPath, function (fileEntry:FileEntry):void {
+					fileEntry.file(function (file:File):void {
 						var reader:FileReader = new FileReader();
-						reader.onloadend = function (e):void {
+						reader.onloadend = function (e:Event):void {
 							var newEvent:FileEvent = new FileEvent("READ");
 							newEvent.data = this.result;
 							_target.dispatchEvent(newEvent);
@@ -109,13 +109,13 @@ package org.apache.royale.storage.providers
 							_target.dispatchEvent(finEvent);
 						};
 						reader.readAsText(file);
-					}, function (e):void {
+					}, function (e:Event):void {
 						var err1Event:FileErrorEvent = new FileErrorEvent("ERROR");
 						err1Event.errorMessage = "Cannot open file for reading";
 						err1Event.errorCode = 2;
 						_target.dispatchEvent(err1Event);
 					});
-				}, function (e):void {
+				}, function (e:Event):void {
 					var err2Event:FileErrorEvent = new FileErrorEvent("ERROR");
 					err2Event.errorMessage = "File does not exist";
 					err2Event.errorCode = 1;
@@ -141,19 +141,19 @@ package org.apache.royale.storage.providers
 			COMPILE::JS {
 				var fullPath:String = String(cordova["file"]["dataDirectory"]) + fileName;
 				
-				window.resolveLocalFileSystemURL(fullPath, function (fileEntry):void {
-					fileEntry.file(function (file):void {
+				window.resolveLocalFileSystemURL(fullPath, function (fileEntry:FileEntry):void {
+					fileEntry.file(function (file:FileEntry):void {
 						var inputStream:DataInputStream = new DataInputStream(_target, file, new FileReader());
 						var newEvent:FileEvent = new FileEvent("READY");
 						newEvent.stream = inputStream;
 						_target.dispatchEvent(newEvent);
-					}, function (e):void {
+					}, function (e:Event):void {
 						var err1Event:FileErrorEvent = new FileErrorEvent("ERROR");
 						err1Event.errorMessage = "Cannot open file for reading";
 						err1Event.errorCode = 2;
 						_target.dispatchEvent(err1Event);
 					});
-				}, function (e):void {
+				}, function (e:Event):void {
 					var err2Event:FileErrorEvent = new FileErrorEvent("ERROR");
 					err2Event.errorMessage = "File does not exist";
 					err2Event.errorCode = 1;
@@ -181,10 +181,10 @@ package org.apache.royale.storage.providers
 			COMPILE::JS {
 				var fullPath:String = String(cordova["file"]["dataDirectory"]) + fileName;
 		
-				window.resolveLocalFileSystemURL(cordova.file.dataDirectory, function (directoryEntry):void {
-					directoryEntry.getFile(fileName, { 'create': true }, function (fileEntry):void {
-						fileEntry.createWriter(function (fileWriter):void {
-							fileWriter.onwriteend = function (e):void {
+				window.resolveLocalFileSystemURL(cordova.file.dataDirectory, function (directoryEntry:DirectoryEntry):void {
+					directoryEntry.getFile(fileName, new FileSystemCreateFlags(), function (fileEntry:FileEntry):void {
+						fileEntry.createWriter(function (fileWriter:FileWriter):void {
+							fileWriter.onwriteend = function (e:Event):void {
 								var newEvent:FileEvent = new FileEvent("WRITE");
 								_target.dispatchEvent(newEvent);
 								
@@ -192,28 +192,28 @@ package org.apache.royale.storage.providers
 								_target.dispatchEvent(finEvent);
 							};
 							
-							fileWriter.onerror = function (e):void {
+							fileWriter.onerror = function (e:Event):void {
 								var newEvent:FileErrorEvent = new FileErrorEvent("ERROR");
 								newEvent.errorMessage = "Failed to write the file.";
 								newEvent.errorCode = 3;
 								_target.dispatchEvent(newEvent);
 							};
 							
-							var blob:Blob = new Blob([text], { type: 'text/plain' } as BlobPropertyBag);
+							var blob:Blob = new Blob([text], new BlobPlainTextOptions());
 							fileWriter.write(blob);
-						}, function(e):void {
+						}, function(e:Event):void {
 							var errEvent:FileErrorEvent = new FileErrorEvent("ERROR");
 							errEvent.errorMessage = "Cannot open file for writing.";
 							errEvent.errorCode = 1;
 							_target.dispatchEvent(errEvent);
 						});
-					}, function(e):void {
+					}, function(e:Event):void {
 						var errEvent:FileErrorEvent = new FileErrorEvent("ERROR");
 						errEvent.errorMessage = "Cannot create file.";
 						errEvent.errorCode = 4;
 						_target.dispatchEvent(errEvent);
 					});
-				}, function(e):void {
+				}, function(e:Event):void {
 					var errEvent:FileErrorEvent = new FileErrorEvent("ERROR");
 					errEvent.errorMessage = "Cannot create file.";
 					errEvent.errorCode = 4;
@@ -239,9 +239,9 @@ package org.apache.royale.storage.providers
 			COMPILE::JS {
 				var fullPath:String = String(cordova["file"]["dataDirectory"]) + fileName;
 				
-				window.resolveLocalFileSystemURL(cordova.file.dataDirectory, function (directoryEntry):void {
-					directoryEntry.getFile(fileName, { 'create': true }, function (fileEntry):void {
-						fileEntry.createWriter(function (fileWriter):void {
+				window.resolveLocalFileSystemURL(cordova.file.dataDirectory, function (directoryEntry:DirectoryEntry):void {
+					directoryEntry.getFile(fileName, new FileSystemCreateFlags, function (fileEntry:FileEntry):void {
+						fileEntry.createWriter(function (fileWriter:FileWriter):void {
 							var outputStream:DataOutputStream = new DataOutputStream(_target, fileEntry, fileWriter);
 							var newEvent:FileEvent = new FileEvent("READY");
 							newEvent.stream = outputStream;
@@ -253,3 +253,41 @@ package org.apache.royale.storage.providers
 		}
 	}
 }
+
+COMPILE::JS
+class BlobPlainTextOptions implements BlobPropertyBag
+{
+    public function get type():String
+    {
+        return "text/plain";
+    }
+    
+    public function set type(value:String):void
+    {
+        
+    }
+}
+
+COMPILE::JS
+class FileSystemCreateFlags implements FileSystemFlags
+{
+    public function get create():Boolean
+    {
+        return true;
+    }
+    
+    public function set create(value:Boolean):void
+    {
+        
+    }
+    
+    public function get exclusive():Boolean
+    {
+        return false;
+    }
+    
+    public function set exclusive(value:Boolean):void
+    {
+        
+    }
+}