You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flex.apache.org by jo...@apache.org on 2016/07/15 17:11:17 UTC
[1/2] git commit: [flex-asjs] [refs/heads/develop] - Language: new
project that pulls out Namespace, QName, and org.apache.flex.utils.Language
into a separate SWC that doesn't have framework stuff;
swapped Core.swc for Language.swc in js/node/jquery-conf
Repository: flex-asjs
Updated Branches:
refs/heads/develop 5a3570bba -> f590e91cc
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/f590e91c/frameworks/projects/Language/src/main/flex/org/apache/flex/utils/Language.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Language/src/main/flex/org/apache/flex/utils/Language.as b/frameworks/projects/Language/src/main/flex/org/apache/flex/utils/Language.as
new file mode 100644
index 0000000..611bb0f
--- /dev/null
+++ b/frameworks/projects/Language/src/main/flex/org/apache/flex/utils/Language.as
@@ -0,0 +1,432 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to You under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+package org.apache.flex.utils
+{
+
+ [ExcludeClass]
+ COMPILE::SWF
+ public class Language {}
+
+ COMPILE::JS
+ {
+ import goog.bind;
+ import goog.global;
+ }
+
+ /**
+ * @flexjsignoreimport goog.bind
+ * @flexjsignoreimport goog.global
+ */
+ COMPILE::JS
+ public class Language
+ {
+
+ //--------------------------------------
+ // Static Property
+ //--------------------------------------
+
+
+ /**
+ * Helper var for sortOn
+ */
+ static private var sortNames:Array;
+ static private var sortNamesOne:Array = [];
+ static private var muler:Number;
+ static private var zeroStr:String = String.fromCharCode(0);
+
+ //--------------------------------------
+ // Static Function
+ //--------------------------------------
+
+ /**
+ * as()
+ *
+ * @param leftOperand The lefthand operand of the
+ * binary as operator in AS3.
+ * @param rightOperand The righthand operand of the
+ * binary operator in AS3.
+ * @param coercion The cast is a coercion,
+ * throw exception if it fails.
+ * @return Returns the lefthand operand if it is of the
+ * type of the righthand operand, otherwise null.
+ */
+ static public function as(leftOperand:Object, rightOperand:Object, coercion:* = null):Object
+ {
+ var error:Error, itIs:Boolean, message:String;
+
+ coercion = (coercion !== undefined) ? coercion : false;
+
+ itIs = Language.is(leftOperand, rightOperand);
+
+ if (!itIs && coercion)
+ {
+ message = 'Type Coercion failed';
+
+ if (TypeError)
+ {
+ error = new TypeError(message);
+ }
+ else
+ {
+ error = new Error(message);
+ }
+ throw error;
+ }
+
+ return (itIs) ? leftOperand : null;
+ }
+
+
+ /**
+ * int()
+ *
+ * @param value The value to be cast.
+ * @return {number}
+ */
+ static public function _int(value:Number):Number
+ {
+ return value >> 0;
+ }
+
+ /**
+ * is()
+ *
+ * @param leftOperand The lefthand operand of the
+ * binary as operator in AS3.
+ * @param rightOperand The righthand operand of the
+ * binary operator in AS3.
+ * @return {boolean}
+ */
+ static public function is(leftOperand:Object, rightOperand:Object):Boolean
+ {
+ var superClass:Object;
+
+ if (leftOperand == null || rightOperand == null)
+ return false;
+
+ if (leftOperand instanceof rightOperand)
+ return true;
+ if (rightOperand === Object)
+ return true; // every value is an Object in ActionScript except null and undefined (caught above)
+
+ if (typeof leftOperand === 'string')
+ return rightOperand === String;
+
+ if (typeof leftOperand === 'number')
+ return rightOperand === Number;
+
+ if (typeof leftOperand === 'boolean')
+ return rightOperand === Boolean;
+ if (rightOperand === Array)
+ return Array.isArray(leftOperand);
+
+ if (leftOperand.FLEXJS_CLASS_INFO === undefined)
+ return false; // could be a function but not an instance
+
+ if (leftOperand.FLEXJS_CLASS_INFO.interfaces)
+ {
+ if (checkInterfaces(leftOperand, rightOperand))
+ {
+ return true;
+ }
+ }
+
+ superClass = leftOperand.constructor;
+ superClass = superClass.superClass_;
+
+ if (superClass)
+ {
+ while (superClass && superClass.FLEXJS_CLASS_INFO)
+ {
+ if (superClass.FLEXJS_CLASS_INFO.interfaces)
+ {
+ if (checkInterfaces(superClass, rightOperand))
+ {
+ return true;
+ }
+ }
+ superClass = superClass.constructor;
+ superClass = superClass.superClass_;
+ }
+ }
+
+ return false;
+ }
+
+ /**
+ * Helper function for is()
+ */
+ private static function checkInterfaces(leftOperand:*, rightOperand:*):Boolean
+ {
+ var i:int, interfaces:Array;
+
+ interfaces = leftOperand.FLEXJS_CLASS_INFO.interfaces;
+ for (i = interfaces.length - 1; i > -1; i--) {
+ if (interfaces[i] === rightOperand) {
+ return true;
+ }
+
+ if (interfaces[i].prototype.FLEXJS_CLASS_INFO.interfaces) {
+ var isit:Boolean = checkInterfaces(interfaces[i].prototype, rightOperand);
+ if (isit) return true;
+ }
+ }
+
+ return false;
+ }
+
+ /**
+ * Implementation of "classDef is Class"
+ */
+ public function isClass(classDef:*):Boolean
+ {
+ return typeof classDef === 'function'
+ && classDef.prototype
+ && classDef.prototype.constructor === classDef;
+ }
+
+ /**
+ * Implementation of "classDef as Class"
+ */
+ public function asClass(classDef:*):Class
+ {
+ return isClass(classDef) ? classDef : null;
+ }
+
+ /**
+ * postdecrement handles foo--
+ *
+ * @param obj The object with the getter/setter.
+ * @param prop The name of a property.
+ * @return {number}
+ */
+ static public function postdecrement(obj:Object, prop:String):int
+ {
+ var value:int = obj[prop];
+ obj[prop] = value - 1;
+ return value;
+ }
+
+ /**
+ * postincrement handles foo++
+ *
+ * @param obj The object with the getter/setter.
+ * @param prop The name of a property.
+ * @return {number}
+ */
+ static public function postincrement(obj:Object, prop:String):int
+ {
+ var value:int = obj[prop];
+ obj[prop] = value + 1;
+ return value;
+ }
+
+ /**
+ * predecrement handles --foo
+ *
+ * @param obj The object with the getter/setter.
+ * @param prop The name of a property.
+ * @return {number}
+ */
+ static public function predecrement(obj:Object, prop:String):int
+ {
+ var value:int = obj[prop] - 1;
+ obj[prop] = value;
+ return value;
+ }
+
+ /**
+ * preincrement handles ++foo
+ *
+ * @param obj The object with the getter/setter.
+ * @param prop The name of a property.
+ * @return {number}
+ */
+ static public function preincrement(obj:Object, prop:String):int
+ {
+ var value:int = obj[prop] + 1;
+ obj[prop] = value;
+ return value;
+ }
+
+ /**
+ * superGetter calls the getter on the given class' superclass.
+ *
+ * @param clazz The class.
+ * @param pthis The this pointer.
+ * @param prop The name of the getter.
+ * @return {Object}
+ */
+ static public function superGetter(clazz:Object, pthis:Object, prop:String):Object
+ {
+ var superClass:Object = clazz.superClass_;
+ var superdesc:Object = Object.getOwnPropertyDescriptor(superClass, prop);
+
+ while (superdesc == null)
+ {
+ superClass = superClass.constructor;
+ superClass = superClass.superClass_;
+ superdesc = Object.getOwnPropertyDescriptor(superClass, prop);
+ }
+ return superdesc.get.call(pthis);
+ }
+
+ /**
+ * superSetter calls the setter on the given class' superclass.
+ *
+ * @param clazz The class.
+ * @param pthis The this pointer.
+ * @param prop The name of the getter.
+ * @param value The value.
+ */
+ static public function superSetter(clazz:Object, pthis:Object, prop:String, value:Object):void
+ {
+ var superClass:Object = clazz.superClass_;
+ var superdesc:Object = Object.getOwnPropertyDescriptor(superClass, prop);
+
+ while (superdesc == null)
+ {
+ superClass = superClass.constructor;
+ superClass = superClass.superClass_;
+ superdesc = Object.getOwnPropertyDescriptor(superClass, prop);
+ }
+ superdesc.set.apply(pthis, [value]);
+ }
+
+ static public function trace(...rest):void
+ {
+ var theConsole:*;
+
+ theConsole = goog.global.console;
+
+ if (theConsole === undefined)
+ {
+ if(typeof window !== "undefined")
+ {
+ theConsole = window.console;
+ }
+ else if(typeof console !== "undefined")
+ {
+ theConsole = console;
+ }
+ }
+
+ try
+ {
+ if (theConsole && theConsole.log)
+ {
+ theConsole.log.apply(theConsole, rest);
+ }
+ }
+ catch (e:Error)
+ {
+ // ignore; at least we tried ;-)
+ }
+ }
+
+ /**
+ * uint()
+ *
+ * @param value The value to be cast.
+ * @return {number}
+ */
+ static public function uint(value:Number):Number
+ {
+ return value >>> 0;
+ }
+
+ /**
+ * caches closures and returns the one closure
+ *
+ * @param fn The method on the instance.
+ * @param object The instance.
+ * @param boundMethodName The name to use to cache the closure.
+ * @return The closure.
+ */
+ static public function closure(fn:Function, object:Object, boundMethodName:String):Function {
+ if (object.hasOwnProperty(boundMethodName)) {
+ return object[boundMethodName];
+ }
+ var boundMethod:Function = goog.bind(fn, object);
+ Object.defineProperty(object, boundMethodName, {
+ value: boundMethod
+ });
+ return boundMethod;
+ };
+
+ /**
+ * @param arr
+ * @param names
+ * @param opt
+ */
+ public static function sortOn(arr:Array,names:Object,opt:Object=0):void{
+ if (names is Array){
+ sortNames = names as Array;
+ }else{
+ sortNamesOne[0] = names;
+ sortNames = sortNamesOne;
+ }
+ if (opt is Array){
+ var opt2:int = 0;
+ for each(var o:int in opt){
+ opt2 = opt2 | o;
+ }
+ }else{
+ opt2 = opt as int;
+ }
+ muler = (Array.DESCENDING & opt2) > 0?-1: 1;
+ if(opt2&Array.NUMERIC){
+ arr.sort(compareNumber);
+ }else if (opt2&Array.CASEINSENSITIVE){
+ arr.sort(compareStringCaseinsensitive);
+ }else{
+ arr.sort(compareString);
+ }
+ }
+ private static function compareStringCaseinsensitive(a:Object, b:Object):int{
+ for each(var n:String in sortNames){
+ var v:int = (a[n]||zeroStr).toString().toLowerCase().localeCompare((b[n]||zeroStr).toString().toLowerCase());
+ if (v != 0){
+ return v*muler;
+ }
+ }
+ return 0;
+ }
+ private static function compareString(a:Object, b:Object):int{
+ for each(var n:String in sortNames){
+ var v:int = (a[n]||zeroStr).toString().localeCompare((b[n]||zeroStr).toString());
+ if (v != 0){
+ return v*muler;
+ }
+ }
+ return 0;
+ }
+
+ private static function compareNumber(a:Object, b:Object):int{
+ for each(var n:String in sortNames){
+ if (a[n]>b[n]){
+ return muler;
+ }else if (a[n]<b[n]){
+ return -muler;
+ }
+ }
+ return 0;
+ }
+ }
+}
[2/2] git commit: [flex-asjs] [refs/heads/develop] - Language: new
project that pulls out Namespace, QName, and org.apache.flex.utils.Language
into a separate SWC that doesn't have framework stuff;
swapped Core.swc for Language.swc in js/node/jquery-conf
Posted by jo...@apache.org.
Language: new project that pulls out Namespace, QName, and org.apache.flex.utils.Language into a separate SWC that doesn't have framework stuff; swapped Core.swc for Language.swc in js/node/jquery-config.xml; fixed builds of JS projects that didn't like a SWC being referenced in js-config.xml (thanks to Greg Dove)
Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/f590e91c
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/f590e91c
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/f590e91c
Branch: refs/heads/develop
Commit: f590e91ccb89541fde085f3b9698d0742af4ebd3
Parents: 5a3570b
Author: Josh Tynjala <jo...@apache.org>
Authored: Fri Jul 15 10:00:54 2016 -0700
Committer: Josh Tynjala <jo...@apache.org>
Committed: Fri Jul 15 10:00:54 2016 -0700
----------------------------------------------------------------------
frameworks/build.xml | 6 +
frameworks/jquery-config-template.xml | 2 +-
frameworks/jquery-config.xml | 1 +
frameworks/js-config-template.xml | 2 +-
frameworks/js-config.xml | 1 +
frameworks/js/FlexJS/build.xml | 6 +
.../src/main/config/compile-js-config.xml | 4 +-
.../src/main/config/compile-js-config.xml | 4 +-
.../src/main/config/compile-js-config.xml | 4 +-
.../src/main/config/compile-js-config.xml | 5 +
.../src/main/config/compile-js-config.xml | 4 +-
.../src/main/config/compile-js-config.xml | 4 +-
.../src/main/config/compile-js-config.xml | 4 +-
.../src/main/config/compile-js-config.xml | 4 +-
.../src/main/config/compile-js-config.xml | 4 +-
.../src/main/config/compile-js-config.xml | 4 +-
.../src/main/config/compile-js-config.xml | 4 +-
.../src/main/config/compile-js-config.xml | 4 +-
.../src/main/config/compile-js-config.xml | 4 +-
.../js/FlexJS/projects/LanguageJS/build.xml | 138 ++++++
.../src/main/config/compile-js-config.xml | 76 ++++
.../src/main/config/compile-js-config.xml | 4 +-
.../src/main/config/compile-js-config.xml | 4 +-
.../src/main/config/compile-js-config.xml | 4 +-
.../src/main/config/compile-js-config.xml | 4 +-
.../XMLJS/src/main/config/compile-js-config.xml | 5 +-
frameworks/node-config-template.xml | 2 +-
frameworks/node-config.xml | 1 +
.../projects/Core/src/main/flex/CoreClasses.as | 7 -
.../projects/Core/src/main/flex/Namespace.as | 135 ------
frameworks/projects/Core/src/main/flex/QName.as | 170 --------
.../main/flex/org/apache/flex/utils/Language.as | 432 -------------------
frameworks/projects/Language/build.xml | 119 +++++
frameworks/projects/Language/pom.xml | 58 +++
.../src/main/config/compile-as-config.xml | 69 +++
.../Language/src/main/flex/LanguageClasses.as | 38 ++
.../Language/src/main/flex/Namespace.as | 135 ++++++
.../projects/Language/src/main/flex/QName.as | 170 ++++++++
.../main/flex/org/apache/flex/utils/Language.as | 432 +++++++++++++++++++
39 files changed, 1310 insertions(+), 764 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/f590e91c/frameworks/build.xml
----------------------------------------------------------------------
diff --git a/frameworks/build.xml b/frameworks/build.xml
index acfb01e..2acfddc 100644
--- a/frameworks/build.xml
+++ b/frameworks/build.xml
@@ -76,6 +76,7 @@
<target name="compile" description="Builds all SWCs but not their resource bundles">
<!-- order may matter due to dependencies -->
+ <antcall target="Language"/>
<antcall target="Core"/>
<antcall target="Graphics"/>
<antcall target="Binding"/>
@@ -135,6 +136,7 @@
<ant dir="${basedir}/projects/HTML" target="clean"/>
<ant dir="${basedir}/projects/HTML5" target="clean"/>
<ant dir="${basedir}/projects/JQuery" target="clean"/>
+ <ant dir="${basedir}/projects/Language" target="clean"/>
<ant dir="${basedir}/projects/Mobile" target="clean"/>
<ant dir="${basedir}/projects/Network" target="clean"/>
<ant dir="${basedir}/projects/Reflection" target="clean"/>
@@ -219,6 +221,10 @@
<ant dir="${basedir}/projects/JQuery"/>
</target>
+ <target name="Language" description="Clean build of Language.swc">
+ <ant dir="${basedir}/projects/Language"/>
+ </target>
+
<target name="Mobile" description="Clean build of Mobile.swc">
<ant dir="${basedir}/projects/Mobile"/>
</target>
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/f590e91c/frameworks/jquery-config-template.xml
----------------------------------------------------------------------
diff --git a/frameworks/jquery-config-template.xml b/frameworks/jquery-config-template.xml
index 97b74fd..6d9cc30 100644
--- a/frameworks/jquery-config-template.xml
+++ b/frameworks/jquery-config-template.xml
@@ -71,7 +71,7 @@
<!-- List of SWC files or directories that contain SWC files. -->
<library-path>
- <path-element>libs/Core.swc</path-element>
+ <path-element>libs/Language.swc</path-element>
<path-element>../js/libs/GCL.swc</path-element>
</library-path>
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/f590e91c/frameworks/jquery-config.xml
----------------------------------------------------------------------
diff --git a/frameworks/jquery-config.xml b/frameworks/jquery-config.xml
index 0399bfc..6a193f2 100644
--- a/frameworks/jquery-config.xml
+++ b/frameworks/jquery-config.xml
@@ -71,6 +71,7 @@
<!-- List of SWC files or directories that contain SWC files. -->
<library-path>
+ <path-element>libs/Language.swc</path-element>
<path-element>../js/libs/GCL.swc</path-element>
</library-path>
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/f590e91c/frameworks/js-config-template.xml
----------------------------------------------------------------------
diff --git a/frameworks/js-config-template.xml b/frameworks/js-config-template.xml
index 5e1944e..4818f65 100644
--- a/frameworks/js-config-template.xml
+++ b/frameworks/js-config-template.xml
@@ -70,7 +70,7 @@
<!-- List of SWC files or directories that contain SWC files. -->
<library-path>
- <path-element>libs/Core.swc</path-element>
+ <path-element>libs/Language.swc</path-element>
<path-element>../js/libs/GCL.swc</path-element>
</library-path>
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/f590e91c/frameworks/js-config.xml
----------------------------------------------------------------------
diff --git a/frameworks/js-config.xml b/frameworks/js-config.xml
index 17786d9..3e5d58b 100644
--- a/frameworks/js-config.xml
+++ b/frameworks/js-config.xml
@@ -70,6 +70,7 @@
<!-- List of SWC files or directories that contain SWC files. -->
<library-path>
+ <path-element>libs/Language.swc</path-element>
<path-element>../js/libs/GCL.swc</path-element>
</library-path>
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/f590e91c/frameworks/js/FlexJS/build.xml
----------------------------------------------------------------------
diff --git a/frameworks/js/FlexJS/build.xml b/frameworks/js/FlexJS/build.xml
index 182ca4d..a08f92d 100644
--- a/frameworks/js/FlexJS/build.xml
+++ b/frameworks/js/FlexJS/build.xml
@@ -75,6 +75,7 @@
<target name="compile" description="Builds all SWCs but not their resource bundles">
<!-- order may matter due to dependencies -->
+ <antcall target="Language"/>
<antcall target="Core"/>
<antcall target="Graphics"/>
<antcall target="Binding"/>
@@ -130,6 +131,7 @@
<ant dir="${basedir}/projects/HTMLJS" target="clean"/>
<ant dir="${basedir}/projects/HTML5JS" target="clean"/>
<ant dir="${basedir}/projects/JQueryJS" target="clean"/>
+ <ant dir="${basedir}/projects/LanguageJS" target="clean"/>
<ant dir="${basedir}/projects/MobileJS" target="clean"/>
<ant dir="${basedir}/projects/NetworkJS" target="clean"/>
<ant dir="${basedir}/projects/ReflectionJS" target="clean"/>
@@ -196,6 +198,10 @@
<ant dir="${basedir}/projects/JQueryJS"/>
</target>
+ <target name="Language" description="Clean build of Language.swc">
+ <ant dir="${basedir}/projects/LanguageJS"/>
+ </target>
+
<target name="Mobile" description="Clean build of Mobile.swc">
<ant dir="${basedir}/projects/MobileJS"/>
</target>
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/f590e91c/frameworks/js/FlexJS/projects/BindingJS/src/main/config/compile-js-config.xml
----------------------------------------------------------------------
diff --git a/frameworks/js/FlexJS/projects/BindingJS/src/main/config/compile-js-config.xml b/frameworks/js/FlexJS/projects/BindingJS/src/main/config/compile-js-config.xml
index b636275..b49190e 100644
--- a/frameworks/js/FlexJS/projects/BindingJS/src/main/config/compile-js-config.xml
+++ b/frameworks/js/FlexJS/projects/BindingJS/src/main/config/compile-js-config.xml
@@ -47,7 +47,9 @@
<locale/>
- <library-path append="true">
+ <!-- overwrite the default library-path setting -->
+ <library-path>
+ <path-element>../../../../../../../../js/libs/GCL.swc</path-element>
<!-- asjscompc won't 'link' these classes in, but will list their requires
if these swcs are on the external-library-path then their requires
will not be listed -->
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/f590e91c/frameworks/js/FlexJS/projects/ChartsJS/src/main/config/compile-js-config.xml
----------------------------------------------------------------------
diff --git a/frameworks/js/FlexJS/projects/ChartsJS/src/main/config/compile-js-config.xml b/frameworks/js/FlexJS/projects/ChartsJS/src/main/config/compile-js-config.xml
index fd97528..941d5ce 100644
--- a/frameworks/js/FlexJS/projects/ChartsJS/src/main/config/compile-js-config.xml
+++ b/frameworks/js/FlexJS/projects/ChartsJS/src/main/config/compile-js-config.xml
@@ -47,7 +47,9 @@
<locale/>
- <library-path append="true">
+ <!-- overwrite the default library-path setting -->
+ <library-path>
+ <path-element>../../../../../../../../js/libs/GCL.swc</path-element>
<!-- asjscompc won't 'link' these classes in, but will list their requires
if these swcs are on the external-library-path then their requires
will not be listed -->
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/f590e91c/frameworks/js/FlexJS/projects/CollectionsJS/src/main/config/compile-js-config.xml
----------------------------------------------------------------------
diff --git a/frameworks/js/FlexJS/projects/CollectionsJS/src/main/config/compile-js-config.xml b/frameworks/js/FlexJS/projects/CollectionsJS/src/main/config/compile-js-config.xml
index b7a88ff..c900445 100644
--- a/frameworks/js/FlexJS/projects/CollectionsJS/src/main/config/compile-js-config.xml
+++ b/frameworks/js/FlexJS/projects/CollectionsJS/src/main/config/compile-js-config.xml
@@ -47,7 +47,9 @@
<locale/>
- <library-path append="true">
+ <!-- overwrite the default library-path setting -->
+ <library-path>
+ <path-element>../../../../../../../../js/libs/GCL.swc</path-element>
<!-- asjscompc won't 'link' these classes in, but will list their requires
if these swcs are on the external-library-path then their requires
will not be listed -->
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/f590e91c/frameworks/js/FlexJS/projects/CoreJS/src/main/config/compile-js-config.xml
----------------------------------------------------------------------
diff --git a/frameworks/js/FlexJS/projects/CoreJS/src/main/config/compile-js-config.xml b/frameworks/js/FlexJS/projects/CoreJS/src/main/config/compile-js-config.xml
index 3b775e6..caad641 100644
--- a/frameworks/js/FlexJS/projects/CoreJS/src/main/config/compile-js-config.xml
+++ b/frameworks/js/FlexJS/projects/CoreJS/src/main/config/compile-js-config.xml
@@ -53,6 +53,11 @@
<manifest>../../../../../../../projects/Core/src/main/resources/basic-manifest.xml</manifest>
</namespace>
</namespaces>
+
+ <!-- overwrite the default library-path setting -->
+ <library-path>
+ <path-element>../../../../../../../../js/libs/GCL.swc</path-element>
+ </library-path>
<source-path>
<path-element>../../../../../../../projects/Core/src/main/flex</path-element>
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/f590e91c/frameworks/js/FlexJS/projects/DragDropJS/src/main/config/compile-js-config.xml
----------------------------------------------------------------------
diff --git a/frameworks/js/FlexJS/projects/DragDropJS/src/main/config/compile-js-config.xml b/frameworks/js/FlexJS/projects/DragDropJS/src/main/config/compile-js-config.xml
index db9d87b..10ea092 100644
--- a/frameworks/js/FlexJS/projects/DragDropJS/src/main/config/compile-js-config.xml
+++ b/frameworks/js/FlexJS/projects/DragDropJS/src/main/config/compile-js-config.xml
@@ -47,7 +47,9 @@
<locale/>
- <library-path append="true">
+ <!-- overwrite the default library-path setting -->
+ <library-path>
+ <path-element>../../../../../../../../js/libs/GCL.swc</path-element>
<!-- asjscompc won't 'link' these classes in, but will list their requires
if these swcs are on the external-library-path then their requires
will not be listed -->
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/f590e91c/frameworks/js/FlexJS/projects/EffectsJS/src/main/config/compile-js-config.xml
----------------------------------------------------------------------
diff --git a/frameworks/js/FlexJS/projects/EffectsJS/src/main/config/compile-js-config.xml b/frameworks/js/FlexJS/projects/EffectsJS/src/main/config/compile-js-config.xml
index e5abe81..deb72a9 100644
--- a/frameworks/js/FlexJS/projects/EffectsJS/src/main/config/compile-js-config.xml
+++ b/frameworks/js/FlexJS/projects/EffectsJS/src/main/config/compile-js-config.xml
@@ -47,7 +47,9 @@
<locale/>
- <library-path append="true">
+ <!-- overwrite the default library-path setting -->
+ <library-path>
+ <path-element>../../../../../../../../js/libs/GCL.swc</path-element>
<!-- asjscompc won't 'link' these classes in, but will list their requires
if these swcs are on the external-library-path then their requires
will not be listed -->
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/f590e91c/frameworks/js/FlexJS/projects/FlatJS/src/main/config/compile-js-config.xml
----------------------------------------------------------------------
diff --git a/frameworks/js/FlexJS/projects/FlatJS/src/main/config/compile-js-config.xml b/frameworks/js/FlexJS/projects/FlatJS/src/main/config/compile-js-config.xml
index 1f67c8e..e272078 100644
--- a/frameworks/js/FlexJS/projects/FlatJS/src/main/config/compile-js-config.xml
+++ b/frameworks/js/FlexJS/projects/FlatJS/src/main/config/compile-js-config.xml
@@ -47,7 +47,9 @@
<locale/>
- <library-path append="true">
+ <!-- overwrite the default library-path setting -->
+ <library-path>
+ <path-element>../../../../../../../../js/libs/GCL.swc</path-element>
<!-- asjscompc won't 'link' these classes in, but will list their requires
if these swcs are on the external-library-path then their requires
will not be listed -->
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/f590e91c/frameworks/js/FlexJS/projects/FormattersJS/src/main/config/compile-js-config.xml
----------------------------------------------------------------------
diff --git a/frameworks/js/FlexJS/projects/FormattersJS/src/main/config/compile-js-config.xml b/frameworks/js/FlexJS/projects/FormattersJS/src/main/config/compile-js-config.xml
index cf98e5d..09e3956 100644
--- a/frameworks/js/FlexJS/projects/FormattersJS/src/main/config/compile-js-config.xml
+++ b/frameworks/js/FlexJS/projects/FormattersJS/src/main/config/compile-js-config.xml
@@ -47,7 +47,9 @@
<locale/>
- <library-path append="true">
+ <!-- overwrite the default library-path setting -->
+ <library-path>
+ <path-element>../../../../../../../../js/libs/GCL.swc</path-element>
<!-- asjscompc won't 'link' these classes in, but will list their requires
if these swcs are on the external-library-path then their requires
will not be listed -->
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/f590e91c/frameworks/js/FlexJS/projects/GoogleMapsJS/src/main/config/compile-js-config.xml
----------------------------------------------------------------------
diff --git a/frameworks/js/FlexJS/projects/GoogleMapsJS/src/main/config/compile-js-config.xml b/frameworks/js/FlexJS/projects/GoogleMapsJS/src/main/config/compile-js-config.xml
index 1525e60..2a1a3e4 100644
--- a/frameworks/js/FlexJS/projects/GoogleMapsJS/src/main/config/compile-js-config.xml
+++ b/frameworks/js/FlexJS/projects/GoogleMapsJS/src/main/config/compile-js-config.xml
@@ -51,7 +51,9 @@
<locale/>
- <library-path append="true">
+ <!-- overwrite the default library-path setting -->
+ <library-path>
+ <path-element>../../../../../../../../js/libs/GCL.swc</path-element>
<!-- asjscompc won't 'link' these classes in, but will list their requires
if these swcs are on the external-library-path then their requires
will not be listed -->
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/f590e91c/frameworks/js/FlexJS/projects/GraphicsJS/src/main/config/compile-js-config.xml
----------------------------------------------------------------------
diff --git a/frameworks/js/FlexJS/projects/GraphicsJS/src/main/config/compile-js-config.xml b/frameworks/js/FlexJS/projects/GraphicsJS/src/main/config/compile-js-config.xml
index d0b74b8..dfc63c9 100644
--- a/frameworks/js/FlexJS/projects/GraphicsJS/src/main/config/compile-js-config.xml
+++ b/frameworks/js/FlexJS/projects/GraphicsJS/src/main/config/compile-js-config.xml
@@ -47,7 +47,9 @@
<locale/>
- <library-path append="true">
+ <!-- overwrite the default library-path setting -->
+ <library-path>
+ <path-element>../../../../../../../../js/libs/GCL.swc</path-element>
<!-- asjscompc won't 'link' these classes in, but will list their requires
if these swcs are on the external-library-path then their requires
will not be listed -->
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/f590e91c/frameworks/js/FlexJS/projects/HTML5JS/src/main/config/compile-js-config.xml
----------------------------------------------------------------------
diff --git a/frameworks/js/FlexJS/projects/HTML5JS/src/main/config/compile-js-config.xml b/frameworks/js/FlexJS/projects/HTML5JS/src/main/config/compile-js-config.xml
index f3fe8ac..af4d531 100644
--- a/frameworks/js/FlexJS/projects/HTML5JS/src/main/config/compile-js-config.xml
+++ b/frameworks/js/FlexJS/projects/HTML5JS/src/main/config/compile-js-config.xml
@@ -47,7 +47,9 @@
<locale/>
- <library-path append="true">
+ <!-- overwrite the default library-path setting -->
+ <library-path>
+ <path-element>../../../../../../../../js/libs/GCL.swc</path-element>
<!-- asjscompc won't 'link' these classes in, but will list their requires
if these swcs are on the external-library-path then their requires
will not be listed -->
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/f590e91c/frameworks/js/FlexJS/projects/HTMLJS/src/main/config/compile-js-config.xml
----------------------------------------------------------------------
diff --git a/frameworks/js/FlexJS/projects/HTMLJS/src/main/config/compile-js-config.xml b/frameworks/js/FlexJS/projects/HTMLJS/src/main/config/compile-js-config.xml
index 0ec549e..4a555f0 100644
--- a/frameworks/js/FlexJS/projects/HTMLJS/src/main/config/compile-js-config.xml
+++ b/frameworks/js/FlexJS/projects/HTMLJS/src/main/config/compile-js-config.xml
@@ -47,7 +47,9 @@
<locale/>
- <library-path append="true">
+ <!-- overwrite the default library-path setting -->
+ <library-path>
+ <path-element>../../../../../../../../js/libs/GCL.swc</path-element>
<!-- asjscompc won't 'link' these classes in, but will list their requires
if these swcs are on the external-library-path then their requires
will not be listed -->
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/f590e91c/frameworks/js/FlexJS/projects/JQueryJS/src/main/config/compile-js-config.xml
----------------------------------------------------------------------
diff --git a/frameworks/js/FlexJS/projects/JQueryJS/src/main/config/compile-js-config.xml b/frameworks/js/FlexJS/projects/JQueryJS/src/main/config/compile-js-config.xml
index 8426df3..2eecdc8 100644
--- a/frameworks/js/FlexJS/projects/JQueryJS/src/main/config/compile-js-config.xml
+++ b/frameworks/js/FlexJS/projects/JQueryJS/src/main/config/compile-js-config.xml
@@ -47,7 +47,9 @@
<locale/>
- <library-path append="true">
+ <!-- overwrite the default library-path setting -->
+ <library-path>
+ <path-element>../../../../../../../../js/libs/GCL.swc</path-element>
<!-- asjscompc won't 'link' these classes in, but will list their requires
if these swcs are on the external-library-path then their requires
will not be listed -->
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/f590e91c/frameworks/js/FlexJS/projects/LanguageJS/build.xml
----------------------------------------------------------------------
diff --git a/frameworks/js/FlexJS/projects/LanguageJS/build.xml b/frameworks/js/FlexJS/projects/LanguageJS/build.xml
new file mode 100644
index 0000000..75968a2
--- /dev/null
+++ b/frameworks/js/FlexJS/projects/LanguageJS/build.xml
@@ -0,0 +1,138 @@
+<?xml version="1.0"?>
+<!--
+
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+-->
+
+
+<project name="LanguageJS" default="main" basedir=".">
+ <property name="FLEXJS_HOME" location="../../../../.."/>
+
+ <property file="${FLEXJS_HOME}/env.properties"/>
+ <property environment="env"/>
+ <property file="${FLEXJS_HOME}/build.properties"/>
+ <property name="FLEX_HOME" value="${FLEXJS_HOME}"/>
+
+ <property name="target.name" value="${ant.project.name}.swc" />
+
+ <target name="main" depends="clean,check-compiler,compile-js-swc,compile-asjs,copy-js" description="Full build of ${ant.project.name}.swc">
+ </target>
+
+ <target name="clean">
+ <delete failonerror="false">
+ <fileset dir="${FLEXJS_HOME}/frameworks/js/FlexJS/libs">
+ <include name="${target.name}"/>
+ </fileset>
+ </delete>
+ <delete failonerror="false" includeemptydirs="true">
+ <fileset dir="${basedir}/target">
+ <include name="**/**"/>
+ </fileset>
+ </delete>
+ </target>
+
+ <target name="compile-asjs" depends="check-compiler">
+ <echo message="Cross-compiling ${target.name}"/>
+ <echo message="FALCONJX_HOME: ${FALCONJX_HOME}"/>
+ <mkdir dir="${basedir}/target/generated-sources/flexjs"/>
+ <java jar="${FALCONJX_HOME}/lib/compc.jar" fork="true" >
+ <jvmarg value="-Xmx384m" />
+ <jvmarg value="-Dsun.io.useCanonCaches=false" />
+ <jvmarg value="-Dflexcompiler=${FALCONJX_HOME}/../compiler" />
+ <jvmarg value="-Dflexlib=${FLEXJS_HOME}/frameworks" />
+ <arg value="+flexlib=${FLEX_HOME}/frameworks" />
+ <arg value="-js-output-type=FLEXJS" />
+ <arg value="-compiler.strict-xml=true" />
+ <arg value="-keep-asdoc" /><!-- allows compiler to see @flexjsignorecoercion annotations -->
+ <arg value="-output=${basedir}/target/generated-sources/flexjs" />
+ <arg value="-load-config=${FLEX_HOME}/frameworks/js-config.xml" />
+ <arg value="-load-config+=${basedir}/src/main/config/compile-js-config.xml" />
+ </java>
+ </target>
+
+ <target name="compile-js-swc" description="Compiles .as files into .swc used for cross-compiling other projects">
+ <echo message="Compiling target/${target.name}"/>
+ <echo message="FLEX_HOME: ${FLEX_HOME}"/>
+ <echo message="FALCON_HOME: ${FALCON_HOME}"/>
+ <mkdir dir="${FLEXJS_HOME}/frameworks/js/FlexJS/libs"/>
+ <mkdir dir="${basedir}/target"/>
+
+ <compc fork="true"
+ output="${basedir}/target/${target.name}">
+ <jvmarg line="${compc.jvm.args}"/>
+ <load-config filename="${FLEX_HOME}/frameworks/js-config.xml" />
+ <load-config filename="src/main/config/compile-js-config.xml" />
+ <arg value="-compiler.strict-xml=true" />
+ </compc>
+ <copy file="${basedir}/target/${target.name}" tofile="${FLEXJS_HOME}/frameworks/js/FlexJS/libs/${target.name}" />
+ </target>
+
+ <target name="copy-js" >
+ <mkdir dir="${FLEXJS_HOME}/frameworks/js/FlexJS/generated-sources"/>
+ <copy todir="${FLEXJS_HOME}/frameworks/js/FlexJS/generated-sources">
+ <fileset dir="${basedir}/target/generated-sources/flexjs">
+ <include name="**/**" />
+ </fileset>
+ </copy>
+ </target>
+
+ <target name="check-compiler" depends="check-falcon-home, check-falconjx-home">
+ <path id="lib.path">
+ <fileset dir="${FALCON_HOME}/lib" includes="falcon-flexTasks.jar"/>
+ </path>
+ <taskdef resource="flexTasks.tasks" classpathref="lib.path"/>
+ </target>
+
+ <target name="check-falcon-home" unless="FALCON_HOME"
+ description="Check FALCON_HOME is a directory.">
+
+ <echo message="FALCON_HOME is ${env.FALCON_HOME}"/>
+
+ <available file="${env.FALCON_HOME}/lib/falcon-mxmlc.jar"
+ type="file"
+ property="FALCON_HOME"
+ value="${env.FALCON_HOME}"/>
+
+ <available file="${FLEXJS_HOME}/../flex-falcon/compiler/lib/falcon-mxmlc.jar"
+ type="file"
+ property="FALCON_HOME"
+ value="${FLEXJS_HOME}/../flex-falcon/compiler"/>
+
+ <fail message="FALCON_HOME must be set to a folder with a lib sub-folder containing falcon-mxmlc.jar such as the compiler folder in flex-falcon repo or a FlexJS SDK folder"
+ unless="FALCON_HOME"/>
+ </target>
+
+ <target name="check-falconjx-home" unless="FALCONJX_HOME"
+ description="Check FALCON_HOME is a directory.">
+
+ <echo message="FALCONJX_HOME is ${env.FALCONJX_HOME}"/>
+
+ <available file="${env.FALCONJX_HOME}/lib/jsc.jar"
+ type="file"
+ property="FALCONJX_HOME"
+ value="${env.FALCONJX_HOME}"/>
+
+ <available file="${FLEXJS_HOME}/../flex-falcon/compiler-jx/lib/jsc.jar"
+ type="file"
+ property="FALCONJX_HOME"
+ value="${FLEXJS_HOME}/../flex-falcon/compiler-jx"/>
+
+ <fail message="FALCONJX_HOME must be set to a folder with a lib sub-folder containing jsc.jar such as the compiler-jx folder in flex-falcon repo or the js folder of a FlexJS SDK"
+ unless="FALCONJX_HOME"/>
+ </target>
+
+</project>
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/f590e91c/frameworks/js/FlexJS/projects/LanguageJS/src/main/config/compile-js-config.xml
----------------------------------------------------------------------
diff --git a/frameworks/js/FlexJS/projects/LanguageJS/src/main/config/compile-js-config.xml b/frameworks/js/FlexJS/projects/LanguageJS/src/main/config/compile-js-config.xml
new file mode 100644
index 0000000..9a73cd2
--- /dev/null
+++ b/frameworks/js/FlexJS/projects/LanguageJS/src/main/config/compile-js-config.xml
@@ -0,0 +1,76 @@
+<!--
+
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+-->
+<flex-config>
+
+ <compiler>
+ <accessible>false</accessible>
+
+ <mxml>
+ <children-as-data>true</children-as-data>
+ </mxml>
+ <binding-value-change-event>org.apache.flex.events.ValueChangeEvent</binding-value-change-event>
+ <binding-value-change-event-kind>org.apache.flex.events.ValueChangeEvent</binding-value-change-event-kind>
+ <binding-value-change-event-type>valueChange</binding-value-change-event-type>
+
+ <define>
+ <name>COMPILE::SWF</name>
+ <value>false</value>
+ </define>
+ <define>
+ <name>COMPILE::JS</name>
+ <value>true</value>
+ </define>
+
+ <keep-as3-metadata>
+ <name>Bindable</name>
+ <name>Managed</name>
+ <name>ChangeEvent</name>
+ <name>NonCommittingChangeEvent</name>
+ <name>Transient</name>
+ </keep-as3-metadata>
+
+ <locale/>
+
+ <!-- overwrite the default library-path setting -->
+ <library-path>
+ <path-element>../../../../../../../../js/libs/GCL.swc</path-element>
+ </library-path>
+
+ <source-path>
+ <path-element>../../../../../../../projects/Language/src/main/flex</path-element>
+ </source-path>
+
+ <warn-no-constructor>false</warn-no-constructor>
+
+ <!-- Use of the instanceof operator. -->
+ <warn-instance-of-changes>false</warn-instance-of-changes>
+ </compiler>
+
+ <include-file>
+ </include-file>
+
+ <include-sources>
+ </include-sources>
+
+ <include-classes>
+ <class>LanguageClasses</class>
+ </include-classes>
+
+
+</flex-config>
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/f590e91c/frameworks/js/FlexJS/projects/MobileJS/src/main/config/compile-js-config.xml
----------------------------------------------------------------------
diff --git a/frameworks/js/FlexJS/projects/MobileJS/src/main/config/compile-js-config.xml b/frameworks/js/FlexJS/projects/MobileJS/src/main/config/compile-js-config.xml
index 9574c36..4077eb9 100644
--- a/frameworks/js/FlexJS/projects/MobileJS/src/main/config/compile-js-config.xml
+++ b/frameworks/js/FlexJS/projects/MobileJS/src/main/config/compile-js-config.xml
@@ -52,7 +52,9 @@
<locale/>
- <library-path append="true">
+ <!-- overwrite the default library-path setting -->
+ <library-path>
+ <path-element>../../../../../../../../js/libs/GCL.swc</path-element>
<!-- asjscompc won't 'link' these classes in, but will list their requires
if these swcs are on the external-library-path then their requires
will not be listed -->
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/f590e91c/frameworks/js/FlexJS/projects/NetworkJS/src/main/config/compile-js-config.xml
----------------------------------------------------------------------
diff --git a/frameworks/js/FlexJS/projects/NetworkJS/src/main/config/compile-js-config.xml b/frameworks/js/FlexJS/projects/NetworkJS/src/main/config/compile-js-config.xml
index aab754f..67ce01d 100644
--- a/frameworks/js/FlexJS/projects/NetworkJS/src/main/config/compile-js-config.xml
+++ b/frameworks/js/FlexJS/projects/NetworkJS/src/main/config/compile-js-config.xml
@@ -47,7 +47,9 @@
<locale/>
- <library-path append="true">
+ <!-- overwrite the default library-path setting -->
+ <library-path>
+ <path-element>../../../../../../../../js/libs/GCL.swc</path-element>
<!-- asjscompc won't 'link' these classes in, but will list their requires
if these swcs are on the external-library-path then their requires
will not be listed -->
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/f590e91c/frameworks/js/FlexJS/projects/ReflectionJS/src/main/config/compile-js-config.xml
----------------------------------------------------------------------
diff --git a/frameworks/js/FlexJS/projects/ReflectionJS/src/main/config/compile-js-config.xml b/frameworks/js/FlexJS/projects/ReflectionJS/src/main/config/compile-js-config.xml
index 36acc8f..0d70f6b 100644
--- a/frameworks/js/FlexJS/projects/ReflectionJS/src/main/config/compile-js-config.xml
+++ b/frameworks/js/FlexJS/projects/ReflectionJS/src/main/config/compile-js-config.xml
@@ -47,7 +47,9 @@
<locale/>
- <library-path append="true">
+ <!-- overwrite the default library-path setting -->
+ <library-path>
+ <path-element>../../../../../../../../js/libs/GCL.swc</path-element>
<!-- asjscompc won't 'link' these classes in, but will list their requires
if these swcs are on the external-library-path then their requires
will not be listed -->
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/f590e91c/frameworks/js/FlexJS/projects/StorageJS/src/main/config/compile-js-config.xml
----------------------------------------------------------------------
diff --git a/frameworks/js/FlexJS/projects/StorageJS/src/main/config/compile-js-config.xml b/frameworks/js/FlexJS/projects/StorageJS/src/main/config/compile-js-config.xml
index 651ff1c..7a3296c 100644
--- a/frameworks/js/FlexJS/projects/StorageJS/src/main/config/compile-js-config.xml
+++ b/frameworks/js/FlexJS/projects/StorageJS/src/main/config/compile-js-config.xml
@@ -51,7 +51,9 @@
<locale/>
- <library-path append="true">
+ <!-- overwrite the default library-path setting -->
+ <library-path>
+ <path-element>../../../../../../../../js/libs/GCL.swc</path-element>
<!-- asjscompc won't 'link' these classes in, but will list their requires
if these swcs are on the external-library-path then their requires
will not be listed -->
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/f590e91c/frameworks/js/FlexJS/projects/XMLJS/src/main/config/compile-js-config.xml
----------------------------------------------------------------------
diff --git a/frameworks/js/FlexJS/projects/XMLJS/src/main/config/compile-js-config.xml b/frameworks/js/FlexJS/projects/XMLJS/src/main/config/compile-js-config.xml
index ea37da6..93a3615 100644
--- a/frameworks/js/FlexJS/projects/XMLJS/src/main/config/compile-js-config.xml
+++ b/frameworks/js/FlexJS/projects/XMLJS/src/main/config/compile-js-config.xml
@@ -47,10 +47,13 @@
<locale/>
- <library-path append="true">
+ <!-- overwrite the default library-path setting -->
+ <library-path>
+ <path-element>../../../../../../../../js/libs/GCL.swc</path-element>
<!-- asjscompc won't 'link' these classes in, but will list their requires
if these swcs are on the external-library-path then their requires
will not be listed -->
+ <path-element>../../../../../libs/LanguageJS.swc</path-element>
<path-element>../../../../../libs/CoreJS.swc</path-element>
</library-path>
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/f590e91c/frameworks/node-config-template.xml
----------------------------------------------------------------------
diff --git a/frameworks/node-config-template.xml b/frameworks/node-config-template.xml
index d2157e0..701e978 100644
--- a/frameworks/node-config-template.xml
+++ b/frameworks/node-config-template.xml
@@ -71,7 +71,7 @@
<!-- List of SWC files or directories that contain SWC files. -->
<library-path>
- <path-element>libs/Core.swc</path-element>
+ <path-element>libs/Language.swc</path-element>
<path-element>../js/libs/GCL.swc</path-element>
</library-path>
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/f590e91c/frameworks/node-config.xml
----------------------------------------------------------------------
diff --git a/frameworks/node-config.xml b/frameworks/node-config.xml
index 5af742f..7c0632b 100644
--- a/frameworks/node-config.xml
+++ b/frameworks/node-config.xml
@@ -71,6 +71,7 @@
<!-- List of SWC files or directories that contain SWC files. -->
<library-path>
+ <path-element>libs/Language.swc</path-element>
<path-element>../js/libs/GCL.swc</path-element>
</library-path>
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/f590e91c/frameworks/projects/Core/src/main/flex/CoreClasses.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Core/src/main/flex/CoreClasses.as b/frameworks/projects/Core/src/main/flex/CoreClasses.as
index e49329a..6b4bd4d 100644
--- a/frameworks/projects/Core/src/main/flex/CoreClasses.as
+++ b/frameworks/projects/Core/src/main/flex/CoreClasses.as
@@ -148,13 +148,6 @@ internal class CoreClasses
import org.apache.flex.utils.CSSUtils; CSSUtils;
import org.apache.flex.utils.Proxy; Proxy;
-
- COMPILE::JS
- {
- import org.apache.flex.utils.Language; Language;
- import QName; QName;
- import Namespace; Namespace;
- }
}
}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/f590e91c/frameworks/projects/Core/src/main/flex/Namespace.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Core/src/main/flex/Namespace.as b/frameworks/projects/Core/src/main/flex/Namespace.as
deleted file mode 100644
index 93f8eab..0000000
--- a/frameworks/projects/Core/src/main/flex/Namespace.as
+++ /dev/null
@@ -1,135 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-// Licensed to the Apache Software Foundation (ASF) under one or more
-// contributor license agreements. See the NOTICE file distributed with
-// this work for additional information regarding copyright ownership.
-// The ASF licenses this file to You under the Apache License, Version 2.0
-// (the "License"); you may not use this file except in compliance with
-// the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-////////////////////////////////////////////////////////////////////////////////
-package
-{
- public class Namespace
- {
- COMPILE::JS
- public function Namespace(prefixOrUri:Object=null,uriValue:Object=null)
- {
- /*
- When the Namespace constructor is called with a no arguments, one argument uriValue or two arguments prefixValue and uriValue, the following steps are taken:
- 1. Create a new Namespace object n
- 2. If prefixValue is not specified and uriValue is not specified
- a. Let n.prefix be the empty string
- b. Let n.uri be the empty string
- 3. Else if prefixValue is not specified
- a. If Type(uriValue) is Object and uriValue.[[Class]] == "Namespace"
- i. Let n.prefix = uriValue.prefix
- ii. Let n.uri = uriValue.uri
- b. Else if Type(uriValue) is Object and uriValue.[[Class]] == "QName" and uriValue.uri is not null
- i. Let n.uri = uriValue.uri NOTE implementations that preserve prefixes in qualified names may also set n.prefix = uriValue.[[Prefix]]
- c. Else
- i. Let n.uri = ToString(uriValue)
- ii. If (n.uri is the empty string), let n.prefix be the empty string
- iii. Else n.prefix = undefined
- 4. Else
- a. If Type(uriValue) is Object and uriValue.[[Class]] == "QName" and uriValue.uri is not null
- i. Let n.uri = uriValue.uri
- b. Else
- i. Let n.uri = ToString(uriValue)
- c. If n.uri is the empty string
- i. If prefixValue is undefined or ToString(prefixValue) is the empty string
- 1. Let n.prefix be the empty string
- ii. Else throw a TypeError exception
- d. Else if prefixValue is undefined, let n.prefix = undefined
- e. Else if isXMLName(prefixValue) == false
- i. Let n.prefix = undefined
- f. Else let n.prefix = ToString(prefixValue)
- 5. Return n
- */
- if(!uriValue && prefixOrUri) //we don't have a prefix defined
- {
- var uriVal:Object = uriValue ? uriValue : prefixOrUri;
- if(uriVal is Namespace)
- {
- _prefix = (uriVal as Namespace).prefix;
- _uri = (uriVal as Namespace).uri;
- }
- else if(uriVal is QName)
- {
- if((uriVal as QName).uri)
- _uri = (uriVal as QName).uri;
- }
- else {
- _uri = uriVal.toString();
- if(_uri == "")
- _prefix = "";
- }
- }
- else if(uriValue)
- {
- // something is specified as the URI otherwise fall through and leave both the prefix and uri blank
- if(uriValue is QName)
- {
- if((uriValue as QName).uri)
- _uri = (uriValue as QName).uri;
- }
- else {
- _uri = uriValue.toString();
- }
-
- if(!_uri)
- {
- if(!prefixOrUri)
- _prefix = "";
- else
- throw new TypeError("invalid prefix");
- }
- else
- _prefix = prefixOrUri.toString();
-
- }
- }
-
- private var _uri:String = "";
- public function get uri():String
- {
- return _uri;
- }
- public function set uri(value:String):void
- {
- _uri = value;
- }
-
- private var _prefix:String = null;
- public function get prefix():String
- {
- return _prefix;
- }
- public function set prefix(value:String):void
- {
- _prefix = value;
- }
-
- COMPILE::JS
- public function toString():String
- {
- return uri;
- }
-
- COMPILE::JS
- override public function valueOf():*
- {
- return this;
- }
- }
-}
-
-
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/f590e91c/frameworks/projects/Core/src/main/flex/QName.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Core/src/main/flex/QName.as b/frameworks/projects/Core/src/main/flex/QName.as
deleted file mode 100644
index 057b9d5..0000000
--- a/frameworks/projects/Core/src/main/flex/QName.as
+++ /dev/null
@@ -1,170 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-// Licensed to the Apache Software Foundation (ASF) under one or more
-// contributor license agreements. See the NOTICE file distributed with
-// this work for additional information regarding copyright ownership.
-// The ASF licenses this file to You under the Apache License, Version 2.0
-// (the "License"); you may not use this file except in compliance with
-// the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-////////////////////////////////////////////////////////////////////////////////
-package
-{
- public class QName
- {
- COMPILE::JS
- public function QName(qNameOrUri:*=null,localNameVal:*=null)
- {
- /*
- When the QName constructor is called with a one argument Name or two arguments Namespace and Name the following steps are taken:
- 1. If (Type(Name) is Object and Name.[[Class]] == "QName")
- a. If (Namespace is not specified), return a copy of Name
- b. Else let Name = Name.localName
- 2. If (Name is undefined or not specified)
- a. Let Name = \u201c\u201d
- 3. Else let Name = ToString(Name)
- 4. If (Namespace is undefined or not specified)
- a. If Name = "*"
- i. Let Namespace = null
- b. Else
- i. Let Namespace = GetDefaultNamespace()
- 5. Let q be a new QName with q.localName = Name
- 6. If Namespace == null
- a. Let q.uri = null NOTE implementations that preserve prefixes in qualified names may also set q.[[Prefix]] to undefined
- 7. Else
- a. Let Namespace be a new Namespace created as if by calling the constructor new Namespace(Namespace)
- b. Let q.uri = Namespace.uri NOTE implementations that preserve prefixes in qualified names may also set q.[[Prefix]] to Namespace.prefix
- 8. Return q
- */
- if(qNameOrUri is QName)
- {
- _uri = qNameOrUri.uri;
- _localName = qNameOrUri.localName;
- _prefix = qNameOrUri.prefix;
- }
- else if(qNameOrUri is Namespace)
- {
- _uri = (qNameOrUri as Namespace).uri;
- _prefix = (qNameOrUri as Namespace).prefix;
- if(localNameVal)
- _localName = localNameVal.toString();
- }
- else if(localNameVal)
- {
- _localName = localNameVal;
- _uri = qNameOrUri;
- }
- else if (qNameOrUri && qNameOrUri.toString())
- {
- _localName = qNameOrUri.toString();
- }
- }
-
- private var _uri:String;
- public function get uri():String
- {
- return _uri;
- }
- public function set uri(value:String):void
- {
- _uri = value;
- }
-
- private var _localName:String;
- public function get localName():String
- {
- return _localName;
- }
- public function set localName(value:String):void
- {
- _localName = value;
- }
-
- private var _prefix:String;
- public function get prefix():String
- {
- return _prefix;
- }
- public function set prefix(value:String):void
- {
- _prefix = value;
- }
-
- COMPILE::JS
- public function toString():String
- {
- var uriVal:String = _uri ? _uri : "*";
- return uriVal + "::" + _localName;
- }
-
- COMPILE::JS
- public function equals(name:QName):Boolean
- {
- return this.uri == name.uri && this.localName == name.localName; // this.prefix == name.prefix &&
- }
-
- COMPILE::JS
- public function matches(name:QName):Boolean
- {
- if(this.uri == "*" || name.uri == "*")
- return this.localName == "*" || name.localName == "*" || this.localName == name.localName;
-
- if(this.localName == "*" || name.localName == "*")
- return this.uri == name.uri;
-
- return this.uri == name.uri && this.localName == name.localName;
- }
- private var _isAttribute:Boolean;
- public function get isAttribute():Boolean
- {
- return _isAttribute;
- }
- public function set isAttribute(value:Boolean):void
- {
- _isAttribute = value;
- }
-
- COMPILE::JS
- public function getNamespace(namespaces:Array=null):Namespace
- {
- /*
- When the [[GetNamespace]] method of a QName q is called with no arguments or one argument InScopeNamespaces, the following steps are taken:
- 1. If q.uri is null, throw a TypeError exception NOTE the exception above should never occur due to the way [[GetNamespace]] is called in this specification
- 2. If InScopeNamespaces was not specified, let InScopeNamespaces = { }
- 3. Find a Namespace ns in InScopeNamespaces, such that ns.uri == q.uri. If more than one such Namespace ns exists, the implementation may choose one of the matching Namespaces arbitrarily. NOTE implementations that preserve prefixes in qualified names may additionally constrain ns, such that ns.prefix == q.[[Prefix]]
- 4. If no such namespace ns exists
- a. Let ns be a new namespace created as if by calling the constructor new Namespace(q.uri) NOTE implementations that preserve prefixes and qualified names may create the new namespaces as if by calling the constructor Namespace(q.[[Prefix]], q.uri)
- 5. Return ns
- */
- var i:int;
- var possibleMatch:Namespace;
- if(!namespaces)
- namespaces = [];
- for(i=0;i<namespaces.length;i++)
- {
- if(namespaces[i].uri == _uri)
- {
- possibleMatch = namespaces[i];
- if(namespaces[i].prefix == _prefix)
- return namespaces[i];
- }
- }
- if(possibleMatch)
- return possibleMatch;
- if(!_prefix)
- return new Namespace(_uri);
- return new Namespace(_prefix,_uri);
- }
-
- }
-}
-
-
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/f590e91c/frameworks/projects/Core/src/main/flex/org/apache/flex/utils/Language.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Core/src/main/flex/org/apache/flex/utils/Language.as b/frameworks/projects/Core/src/main/flex/org/apache/flex/utils/Language.as
deleted file mode 100644
index 611bb0f..0000000
--- a/frameworks/projects/Core/src/main/flex/org/apache/flex/utils/Language.as
+++ /dev/null
@@ -1,432 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-// Licensed to the Apache Software Foundation (ASF) under one or more
-// contributor license agreements. See the NOTICE file distributed with
-// this work for additional information regarding copyright ownership.
-// The ASF licenses this file to You under the Apache License, Version 2.0
-// (the "License"); you may not use this file except in compliance with
-// the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-////////////////////////////////////////////////////////////////////////////////
-package org.apache.flex.utils
-{
-
- [ExcludeClass]
- COMPILE::SWF
- public class Language {}
-
- COMPILE::JS
- {
- import goog.bind;
- import goog.global;
- }
-
- /**
- * @flexjsignoreimport goog.bind
- * @flexjsignoreimport goog.global
- */
- COMPILE::JS
- public class Language
- {
-
- //--------------------------------------
- // Static Property
- //--------------------------------------
-
-
- /**
- * Helper var for sortOn
- */
- static private var sortNames:Array;
- static private var sortNamesOne:Array = [];
- static private var muler:Number;
- static private var zeroStr:String = String.fromCharCode(0);
-
- //--------------------------------------
- // Static Function
- //--------------------------------------
-
- /**
- * as()
- *
- * @param leftOperand The lefthand operand of the
- * binary as operator in AS3.
- * @param rightOperand The righthand operand of the
- * binary operator in AS3.
- * @param coercion The cast is a coercion,
- * throw exception if it fails.
- * @return Returns the lefthand operand if it is of the
- * type of the righthand operand, otherwise null.
- */
- static public function as(leftOperand:Object, rightOperand:Object, coercion:* = null):Object
- {
- var error:Error, itIs:Boolean, message:String;
-
- coercion = (coercion !== undefined) ? coercion : false;
-
- itIs = Language.is(leftOperand, rightOperand);
-
- if (!itIs && coercion)
- {
- message = 'Type Coercion failed';
-
- if (TypeError)
- {
- error = new TypeError(message);
- }
- else
- {
- error = new Error(message);
- }
- throw error;
- }
-
- return (itIs) ? leftOperand : null;
- }
-
-
- /**
- * int()
- *
- * @param value The value to be cast.
- * @return {number}
- */
- static public function _int(value:Number):Number
- {
- return value >> 0;
- }
-
- /**
- * is()
- *
- * @param leftOperand The lefthand operand of the
- * binary as operator in AS3.
- * @param rightOperand The righthand operand of the
- * binary operator in AS3.
- * @return {boolean}
- */
- static public function is(leftOperand:Object, rightOperand:Object):Boolean
- {
- var superClass:Object;
-
- if (leftOperand == null || rightOperand == null)
- return false;
-
- if (leftOperand instanceof rightOperand)
- return true;
- if (rightOperand === Object)
- return true; // every value is an Object in ActionScript except null and undefined (caught above)
-
- if (typeof leftOperand === 'string')
- return rightOperand === String;
-
- if (typeof leftOperand === 'number')
- return rightOperand === Number;
-
- if (typeof leftOperand === 'boolean')
- return rightOperand === Boolean;
- if (rightOperand === Array)
- return Array.isArray(leftOperand);
-
- if (leftOperand.FLEXJS_CLASS_INFO === undefined)
- return false; // could be a function but not an instance
-
- if (leftOperand.FLEXJS_CLASS_INFO.interfaces)
- {
- if (checkInterfaces(leftOperand, rightOperand))
- {
- return true;
- }
- }
-
- superClass = leftOperand.constructor;
- superClass = superClass.superClass_;
-
- if (superClass)
- {
- while (superClass && superClass.FLEXJS_CLASS_INFO)
- {
- if (superClass.FLEXJS_CLASS_INFO.interfaces)
- {
- if (checkInterfaces(superClass, rightOperand))
- {
- return true;
- }
- }
- superClass = superClass.constructor;
- superClass = superClass.superClass_;
- }
- }
-
- return false;
- }
-
- /**
- * Helper function for is()
- */
- private static function checkInterfaces(leftOperand:*, rightOperand:*):Boolean
- {
- var i:int, interfaces:Array;
-
- interfaces = leftOperand.FLEXJS_CLASS_INFO.interfaces;
- for (i = interfaces.length - 1; i > -1; i--) {
- if (interfaces[i] === rightOperand) {
- return true;
- }
-
- if (interfaces[i].prototype.FLEXJS_CLASS_INFO.interfaces) {
- var isit:Boolean = checkInterfaces(interfaces[i].prototype, rightOperand);
- if (isit) return true;
- }
- }
-
- return false;
- }
-
- /**
- * Implementation of "classDef is Class"
- */
- public function isClass(classDef:*):Boolean
- {
- return typeof classDef === 'function'
- && classDef.prototype
- && classDef.prototype.constructor === classDef;
- }
-
- /**
- * Implementation of "classDef as Class"
- */
- public function asClass(classDef:*):Class
- {
- return isClass(classDef) ? classDef : null;
- }
-
- /**
- * postdecrement handles foo--
- *
- * @param obj The object with the getter/setter.
- * @param prop The name of a property.
- * @return {number}
- */
- static public function postdecrement(obj:Object, prop:String):int
- {
- var value:int = obj[prop];
- obj[prop] = value - 1;
- return value;
- }
-
- /**
- * postincrement handles foo++
- *
- * @param obj The object with the getter/setter.
- * @param prop The name of a property.
- * @return {number}
- */
- static public function postincrement(obj:Object, prop:String):int
- {
- var value:int = obj[prop];
- obj[prop] = value + 1;
- return value;
- }
-
- /**
- * predecrement handles --foo
- *
- * @param obj The object with the getter/setter.
- * @param prop The name of a property.
- * @return {number}
- */
- static public function predecrement(obj:Object, prop:String):int
- {
- var value:int = obj[prop] - 1;
- obj[prop] = value;
- return value;
- }
-
- /**
- * preincrement handles ++foo
- *
- * @param obj The object with the getter/setter.
- * @param prop The name of a property.
- * @return {number}
- */
- static public function preincrement(obj:Object, prop:String):int
- {
- var value:int = obj[prop] + 1;
- obj[prop] = value;
- return value;
- }
-
- /**
- * superGetter calls the getter on the given class' superclass.
- *
- * @param clazz The class.
- * @param pthis The this pointer.
- * @param prop The name of the getter.
- * @return {Object}
- */
- static public function superGetter(clazz:Object, pthis:Object, prop:String):Object
- {
- var superClass:Object = clazz.superClass_;
- var superdesc:Object = Object.getOwnPropertyDescriptor(superClass, prop);
-
- while (superdesc == null)
- {
- superClass = superClass.constructor;
- superClass = superClass.superClass_;
- superdesc = Object.getOwnPropertyDescriptor(superClass, prop);
- }
- return superdesc.get.call(pthis);
- }
-
- /**
- * superSetter calls the setter on the given class' superclass.
- *
- * @param clazz The class.
- * @param pthis The this pointer.
- * @param prop The name of the getter.
- * @param value The value.
- */
- static public function superSetter(clazz:Object, pthis:Object, prop:String, value:Object):void
- {
- var superClass:Object = clazz.superClass_;
- var superdesc:Object = Object.getOwnPropertyDescriptor(superClass, prop);
-
- while (superdesc == null)
- {
- superClass = superClass.constructor;
- superClass = superClass.superClass_;
- superdesc = Object.getOwnPropertyDescriptor(superClass, prop);
- }
- superdesc.set.apply(pthis, [value]);
- }
-
- static public function trace(...rest):void
- {
- var theConsole:*;
-
- theConsole = goog.global.console;
-
- if (theConsole === undefined)
- {
- if(typeof window !== "undefined")
- {
- theConsole = window.console;
- }
- else if(typeof console !== "undefined")
- {
- theConsole = console;
- }
- }
-
- try
- {
- if (theConsole && theConsole.log)
- {
- theConsole.log.apply(theConsole, rest);
- }
- }
- catch (e:Error)
- {
- // ignore; at least we tried ;-)
- }
- }
-
- /**
- * uint()
- *
- * @param value The value to be cast.
- * @return {number}
- */
- static public function uint(value:Number):Number
- {
- return value >>> 0;
- }
-
- /**
- * caches closures and returns the one closure
- *
- * @param fn The method on the instance.
- * @param object The instance.
- * @param boundMethodName The name to use to cache the closure.
- * @return The closure.
- */
- static public function closure(fn:Function, object:Object, boundMethodName:String):Function {
- if (object.hasOwnProperty(boundMethodName)) {
- return object[boundMethodName];
- }
- var boundMethod:Function = goog.bind(fn, object);
- Object.defineProperty(object, boundMethodName, {
- value: boundMethod
- });
- return boundMethod;
- };
-
- /**
- * @param arr
- * @param names
- * @param opt
- */
- public static function sortOn(arr:Array,names:Object,opt:Object=0):void{
- if (names is Array){
- sortNames = names as Array;
- }else{
- sortNamesOne[0] = names;
- sortNames = sortNamesOne;
- }
- if (opt is Array){
- var opt2:int = 0;
- for each(var o:int in opt){
- opt2 = opt2 | o;
- }
- }else{
- opt2 = opt as int;
- }
- muler = (Array.DESCENDING & opt2) > 0?-1: 1;
- if(opt2&Array.NUMERIC){
- arr.sort(compareNumber);
- }else if (opt2&Array.CASEINSENSITIVE){
- arr.sort(compareStringCaseinsensitive);
- }else{
- arr.sort(compareString);
- }
- }
- private static function compareStringCaseinsensitive(a:Object, b:Object):int{
- for each(var n:String in sortNames){
- var v:int = (a[n]||zeroStr).toString().toLowerCase().localeCompare((b[n]||zeroStr).toString().toLowerCase());
- if (v != 0){
- return v*muler;
- }
- }
- return 0;
- }
- private static function compareString(a:Object, b:Object):int{
- for each(var n:String in sortNames){
- var v:int = (a[n]||zeroStr).toString().localeCompare((b[n]||zeroStr).toString());
- if (v != 0){
- return v*muler;
- }
- }
- return 0;
- }
-
- private static function compareNumber(a:Object, b:Object):int{
- for each(var n:String in sortNames){
- if (a[n]>b[n]){
- return muler;
- }else if (a[n]<b[n]){
- return -muler;
- }
- }
- return 0;
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/f590e91c/frameworks/projects/Language/build.xml
----------------------------------------------------------------------
diff --git a/frameworks/projects/Language/build.xml b/frameworks/projects/Language/build.xml
new file mode 100644
index 0000000..7a06b78
--- /dev/null
+++ b/frameworks/projects/Language/build.xml
@@ -0,0 +1,119 @@
+<?xml version="1.0"?>
+<!--
+
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+-->
+
+
+<project name="Language" default="main" basedir=".">
+ <property name="FLEXJS_HOME" location="../../.."/>
+
+ <property file="${FLEXJS_HOME}/env.properties"/>
+ <property environment="env"/>
+ <property file="${FLEXJS_HOME}/build.properties"/>
+ <property name="FLEX_HOME" value="${FLEXJS_HOME}"/>
+
+ <property name="target.name" value="${ant.project.name}.swc" />
+
+ <target name="main" depends="clean,check-compiler,js-if-needed,compile,test" description="Full build of ${ant.project.name}.swc">
+ </target>
+
+ <target name="check-js">
+ <uptodate property="js-not-needed" targetfile="${FLEXJS_HOME}/frameworks/js/FlexJS/projects/${ant.project.name}JS/target/${ant.project.name}JS.swc">
+ <srcfiles dir="${basedir}/src/main/flex" includes="**/**"/>
+ </uptodate>
+ </target>
+ <target name="js-if-needed" depends="check-js" unless="js-not-needed">
+ <ant dir="${FLEXJS_HOME}/frameworks/js/FlexJS/projects/${ant.project.name}JS/" inheritAll="false" />
+ </target>
+
+ <target name="check-for-tests" >
+ <condition property="skip-tests" >
+ <not>
+ <available file="${basedir}/src/test/flex/build.xml" />
+ </not>
+ </condition>
+ </target>
+
+ <target name="test" depends="check-for-tests" unless="skip-tests">
+ <ant dir="src/test/flex" />
+ </target>
+
+ <target name="clean">
+ <delete failonerror="false">
+ <fileset dir="${FLEXJS_HOME}/frameworks/libs">
+ <include name="${target.name}"/>
+ </fileset>
+ </delete>
+ <delete failonerror="false" includeemptydirs="true">
+ <fileset dir="${basedir}/target">
+ <include name="**/**"/>
+ </fileset>
+ </delete>
+ <antcall target="clean-tests" />
+ </target>
+
+ <target name="clean-tests" depends="check-for-tests" unless="skip-tests">
+ <ant dir="src/test/flex" target="clean"/>
+ </target>
+
+ <target name="compile" description="Compiles .as files into .swc">
+ <echo message="Compiling libs/${ant.project.name}.swc"/>
+ <echo message="FLEX_HOME: ${FLEX_HOME}"/>
+ <echo message="FALCON_HOME: ${FALCON_HOME}"/>
+ <!-- make JS output folder now so include-file doesn't error -->
+ <mkdir dir="${basedir}/target/generated-sources/flexjs" />
+
+ <compc fork="true"
+ output="${basedir}/target/${target.name}">
+ <jvmarg line="${compc.jvm.args}"/>
+ <load-config filename="${basedir}/src/main/config/compile-as-config.xml" />
+ <arg value="+playerglobal.version=${playerglobal.version}" />
+ <arg value="+env.AIR_HOME=${env.AIR_HOME}" />
+ <arg value="-define=COMPILE::SWF,true" />
+ <arg value="-define=COMPILE::JS,false" />
+ </compc>
+ <copy file="${basedir}/target/${target.name}" tofile="${FLEXJS_HOME}/frameworks/libs/${target.name}" />
+ </target>
+
+ <target name="check-compiler" depends="check-falcon-home">
+ <path id="lib.path">
+ <fileset dir="${FALCON_HOME}/lib" includes="falcon-flexTasks.jar"/>
+ </path>
+ <taskdef resource="flexTasks.tasks" classpathref="lib.path"/>
+ </target>
+
+ <target name="check-falcon-home" unless="FALCON_HOME"
+ description="Check FALCON_HOME is a directory.">
+
+ <echo message="FALCON_HOME is ${env.FALCON_HOME}"/>
+
+ <available file="${env.FALCON_HOME}/lib/falcon-mxmlc.jar"
+ type="file"
+ property="FALCON_HOME"
+ value="${env.FALCON_HOME}"/>
+
+ <available file="${FLEXJS_HOME}/../flex-falcon/compiler/lib/falcon-mxmlc.jar"
+ type="file"
+ property="FALCON_HOME"
+ value="${FLEXJS_HOME}/../flex-falcon/compiler"/>
+
+ <fail message="FALCON_HOME must be set to a folder with a lib sub-folder containing falcon-mxmlc.jar such as the compiler folder in flex-falcon repo or a FlexJS SDK folder"
+ unless="FALCON_HOME"/>
+ </target>
+
+</project>
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/f590e91c/frameworks/projects/Language/pom.xml
----------------------------------------------------------------------
diff --git a/frameworks/projects/Language/pom.xml b/frameworks/projects/Language/pom.xml
new file mode 100644
index 0000000..ad86404
--- /dev/null
+++ b/frameworks/projects/Language/pom.xml
@@ -0,0 +1,58 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+-->
+<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.apache.flex.flexjs.framework</groupId>
+ <artifactId>projects</artifactId>
+ <version>0.7.0-SNAPSHOT</version>
+ </parent>
+
+ <artifactId>Language</artifactId>
+ <version>0.7.0-SNAPSHOT</version>
+ <packaging>swc</packaging>
+
+ <build>
+ <sourceDirectory>src/main/flex</sourceDirectory>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.flex.flexjs.compiler</groupId>
+ <artifactId>flexjs-maven-plugin</artifactId>
+ <version>0.7.0-SNAPSHOT</version>
+ <extensions>true</extensions>
+ <configuration>
+ <includeClasses>
+ <includeClass>LanguageClasses</includeClass>
+ </includeClasses>
+ <includeFiles>
+ <include-file>
+ <name>js/out/*</name>
+ <path>generated-sources/flexjs/*</path>
+ </include-file>
+ </includeFiles>
+ <skipExtern>false</skipExtern>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
+</project>
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/f590e91c/frameworks/projects/Language/src/main/config/compile-as-config.xml
----------------------------------------------------------------------
diff --git a/frameworks/projects/Language/src/main/config/compile-as-config.xml b/frameworks/projects/Language/src/main/config/compile-as-config.xml
new file mode 100644
index 0000000..2bde07e
--- /dev/null
+++ b/frameworks/projects/Language/src/main/config/compile-as-config.xml
@@ -0,0 +1,69 @@
+<!--
+
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+-->
+<flex-config>
+
+ <compiler>
+ <accessible>false</accessible>
+
+ <external-library-path>
+ <path-element>${env.AIR_HOME}/frameworks/libs/air/airglobal.swc</path-element>
+ </external-library-path>
+
+ <mxml>
+ <children-as-data>true</children-as-data>
+ </mxml>
+ <binding-value-change-event>org.apache.flex.events.ValueChangeEvent</binding-value-change-event>
+ <binding-value-change-event-kind>org.apache.flex.events.ValueChangeEvent</binding-value-change-event-kind>
+ <binding-value-change-event-type>valueChange</binding-value-change-event-type>
+
+ <keep-as3-metadata>
+ <name>Bindable</name>
+ <name>Managed</name>
+ <name>ChangeEvent</name>
+ <name>NonCommittingChangeEvent</name>
+ <name>Transient</name>
+ </keep-as3-metadata>
+
+ <locale/>
+
+ <library-path/>
+
+ <source-path>
+ <path-element>../flex</path-element>
+ <!--path-element>generated-sources/asjs</path-element-->
+ </source-path>
+
+ <warn-no-constructor>false</warn-no-constructor>
+
+ <!-- Use of the instanceof operator. -->
+ <warn-instance-of-changes>false</warn-instance-of-changes>
+ </compiler>
+
+ <include-file>
+ <name>js/out/*</name>
+ <path>../../../../../js/FlexJS/projects/LanguageJS/target/generated-sources/flexjs/*</path>
+ </include-file>
+
+ <include-classes>
+ <class>LanguageClasses</class>
+ </include-classes>
+
+ <target-player>20.0</target-player>
+
+</flex-config>
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/f590e91c/frameworks/projects/Language/src/main/flex/LanguageClasses.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Language/src/main/flex/LanguageClasses.as b/frameworks/projects/Language/src/main/flex/LanguageClasses.as
new file mode 100644
index 0000000..4280e23
--- /dev/null
+++ b/frameworks/projects/Language/src/main/flex/LanguageClasses.as
@@ -0,0 +1,38 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to You under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+package {
+
+/**
+ * @private
+ * This class is used to link additional classes into Language.swc
+ * beyond those that are found by dependency analysis starting
+ * from the classes specified in manifest.xml.
+ */
+internal class LanguageClasses
+{
+ COMPILE::JS
+ {
+ import org.apache.flex.utils.Language; Language;
+ import QName; QName;
+ import Namespace; Namespace;
+ }
+}
+
+}
+
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/f590e91c/frameworks/projects/Language/src/main/flex/Namespace.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Language/src/main/flex/Namespace.as b/frameworks/projects/Language/src/main/flex/Namespace.as
new file mode 100644
index 0000000..93f8eab
--- /dev/null
+++ b/frameworks/projects/Language/src/main/flex/Namespace.as
@@ -0,0 +1,135 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to You under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+package
+{
+ public class Namespace
+ {
+ COMPILE::JS
+ public function Namespace(prefixOrUri:Object=null,uriValue:Object=null)
+ {
+ /*
+ When the Namespace constructor is called with a no arguments, one argument uriValue or two arguments prefixValue and uriValue, the following steps are taken:
+ 1. Create a new Namespace object n
+ 2. If prefixValue is not specified and uriValue is not specified
+ a. Let n.prefix be the empty string
+ b. Let n.uri be the empty string
+ 3. Else if prefixValue is not specified
+ a. If Type(uriValue) is Object and uriValue.[[Class]] == "Namespace"
+ i. Let n.prefix = uriValue.prefix
+ ii. Let n.uri = uriValue.uri
+ b. Else if Type(uriValue) is Object and uriValue.[[Class]] == "QName" and uriValue.uri is not null
+ i. Let n.uri = uriValue.uri NOTE implementations that preserve prefixes in qualified names may also set n.prefix = uriValue.[[Prefix]]
+ c. Else
+ i. Let n.uri = ToString(uriValue)
+ ii. If (n.uri is the empty string), let n.prefix be the empty string
+ iii. Else n.prefix = undefined
+ 4. Else
+ a. If Type(uriValue) is Object and uriValue.[[Class]] == "QName" and uriValue.uri is not null
+ i. Let n.uri = uriValue.uri
+ b. Else
+ i. Let n.uri = ToString(uriValue)
+ c. If n.uri is the empty string
+ i. If prefixValue is undefined or ToString(prefixValue) is the empty string
+ 1. Let n.prefix be the empty string
+ ii. Else throw a TypeError exception
+ d. Else if prefixValue is undefined, let n.prefix = undefined
+ e. Else if isXMLName(prefixValue) == false
+ i. Let n.prefix = undefined
+ f. Else let n.prefix = ToString(prefixValue)
+ 5. Return n
+ */
+ if(!uriValue && prefixOrUri) //we don't have a prefix defined
+ {
+ var uriVal:Object = uriValue ? uriValue : prefixOrUri;
+ if(uriVal is Namespace)
+ {
+ _prefix = (uriVal as Namespace).prefix;
+ _uri = (uriVal as Namespace).uri;
+ }
+ else if(uriVal is QName)
+ {
+ if((uriVal as QName).uri)
+ _uri = (uriVal as QName).uri;
+ }
+ else {
+ _uri = uriVal.toString();
+ if(_uri == "")
+ _prefix = "";
+ }
+ }
+ else if(uriValue)
+ {
+ // something is specified as the URI otherwise fall through and leave both the prefix and uri blank
+ if(uriValue is QName)
+ {
+ if((uriValue as QName).uri)
+ _uri = (uriValue as QName).uri;
+ }
+ else {
+ _uri = uriValue.toString();
+ }
+
+ if(!_uri)
+ {
+ if(!prefixOrUri)
+ _prefix = "";
+ else
+ throw new TypeError("invalid prefix");
+ }
+ else
+ _prefix = prefixOrUri.toString();
+
+ }
+ }
+
+ private var _uri:String = "";
+ public function get uri():String
+ {
+ return _uri;
+ }
+ public function set uri(value:String):void
+ {
+ _uri = value;
+ }
+
+ private var _prefix:String = null;
+ public function get prefix():String
+ {
+ return _prefix;
+ }
+ public function set prefix(value:String):void
+ {
+ _prefix = value;
+ }
+
+ COMPILE::JS
+ public function toString():String
+ {
+ return uri;
+ }
+
+ COMPILE::JS
+ override public function valueOf():*
+ {
+ return this;
+ }
+ }
+}
+
+
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/f590e91c/frameworks/projects/Language/src/main/flex/QName.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Language/src/main/flex/QName.as b/frameworks/projects/Language/src/main/flex/QName.as
new file mode 100644
index 0000000..057b9d5
--- /dev/null
+++ b/frameworks/projects/Language/src/main/flex/QName.as
@@ -0,0 +1,170 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to You under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+package
+{
+ public class QName
+ {
+ COMPILE::JS
+ public function QName(qNameOrUri:*=null,localNameVal:*=null)
+ {
+ /*
+ When the QName constructor is called with a one argument Name or two arguments Namespace and Name the following steps are taken:
+ 1. If (Type(Name) is Object and Name.[[Class]] == "QName")
+ a. If (Namespace is not specified), return a copy of Name
+ b. Else let Name = Name.localName
+ 2. If (Name is undefined or not specified)
+ a. Let Name = \u201c\u201d
+ 3. Else let Name = ToString(Name)
+ 4. If (Namespace is undefined or not specified)
+ a. If Name = "*"
+ i. Let Namespace = null
+ b. Else
+ i. Let Namespace = GetDefaultNamespace()
+ 5. Let q be a new QName with q.localName = Name
+ 6. If Namespace == null
+ a. Let q.uri = null NOTE implementations that preserve prefixes in qualified names may also set q.[[Prefix]] to undefined
+ 7. Else
+ a. Let Namespace be a new Namespace created as if by calling the constructor new Namespace(Namespace)
+ b. Let q.uri = Namespace.uri NOTE implementations that preserve prefixes in qualified names may also set q.[[Prefix]] to Namespace.prefix
+ 8. Return q
+ */
+ if(qNameOrUri is QName)
+ {
+ _uri = qNameOrUri.uri;
+ _localName = qNameOrUri.localName;
+ _prefix = qNameOrUri.prefix;
+ }
+ else if(qNameOrUri is Namespace)
+ {
+ _uri = (qNameOrUri as Namespace).uri;
+ _prefix = (qNameOrUri as Namespace).prefix;
+ if(localNameVal)
+ _localName = localNameVal.toString();
+ }
+ else if(localNameVal)
+ {
+ _localName = localNameVal;
+ _uri = qNameOrUri;
+ }
+ else if (qNameOrUri && qNameOrUri.toString())
+ {
+ _localName = qNameOrUri.toString();
+ }
+ }
+
+ private var _uri:String;
+ public function get uri():String
+ {
+ return _uri;
+ }
+ public function set uri(value:String):void
+ {
+ _uri = value;
+ }
+
+ private var _localName:String;
+ public function get localName():String
+ {
+ return _localName;
+ }
+ public function set localName(value:String):void
+ {
+ _localName = value;
+ }
+
+ private var _prefix:String;
+ public function get prefix():String
+ {
+ return _prefix;
+ }
+ public function set prefix(value:String):void
+ {
+ _prefix = value;
+ }
+
+ COMPILE::JS
+ public function toString():String
+ {
+ var uriVal:String = _uri ? _uri : "*";
+ return uriVal + "::" + _localName;
+ }
+
+ COMPILE::JS
+ public function equals(name:QName):Boolean
+ {
+ return this.uri == name.uri && this.localName == name.localName; // this.prefix == name.prefix &&
+ }
+
+ COMPILE::JS
+ public function matches(name:QName):Boolean
+ {
+ if(this.uri == "*" || name.uri == "*")
+ return this.localName == "*" || name.localName == "*" || this.localName == name.localName;
+
+ if(this.localName == "*" || name.localName == "*")
+ return this.uri == name.uri;
+
+ return this.uri == name.uri && this.localName == name.localName;
+ }
+ private var _isAttribute:Boolean;
+ public function get isAttribute():Boolean
+ {
+ return _isAttribute;
+ }
+ public function set isAttribute(value:Boolean):void
+ {
+ _isAttribute = value;
+ }
+
+ COMPILE::JS
+ public function getNamespace(namespaces:Array=null):Namespace
+ {
+ /*
+ When the [[GetNamespace]] method of a QName q is called with no arguments or one argument InScopeNamespaces, the following steps are taken:
+ 1. If q.uri is null, throw a TypeError exception NOTE the exception above should never occur due to the way [[GetNamespace]] is called in this specification
+ 2. If InScopeNamespaces was not specified, let InScopeNamespaces = { }
+ 3. Find a Namespace ns in InScopeNamespaces, such that ns.uri == q.uri. If more than one such Namespace ns exists, the implementation may choose one of the matching Namespaces arbitrarily. NOTE implementations that preserve prefixes in qualified names may additionally constrain ns, such that ns.prefix == q.[[Prefix]]
+ 4. If no such namespace ns exists
+ a. Let ns be a new namespace created as if by calling the constructor new Namespace(q.uri) NOTE implementations that preserve prefixes and qualified names may create the new namespaces as if by calling the constructor Namespace(q.[[Prefix]], q.uri)
+ 5. Return ns
+ */
+ var i:int;
+ var possibleMatch:Namespace;
+ if(!namespaces)
+ namespaces = [];
+ for(i=0;i<namespaces.length;i++)
+ {
+ if(namespaces[i].uri == _uri)
+ {
+ possibleMatch = namespaces[i];
+ if(namespaces[i].prefix == _prefix)
+ return namespaces[i];
+ }
+ }
+ if(possibleMatch)
+ return possibleMatch;
+ if(!_prefix)
+ return new Namespace(_uri);
+ return new Namespace(_prefix,_uri);
+ }
+
+ }
+}
+
+