add enough of Vector so that we can cross-compile it
Project: http://git-wip-us.apache.org/repos/asf/flex-falcon/repo Commit: http://git-wip-us.apache.org/repos/asf/flex-falcon/commit/9a0f6561 Tree: http://git-wip-us.apache.org/repos/asf/flex-falcon/tree/9a0f6561 Diff: http://git-wip-us.apache.org/repos/asf/flex-falcon/diff/9a0f6561 Branch: refs/heads/develop Commit: 9a0f656171a1893e227f1004fd65a55de8774aa2 Parents: ae44574 Author: Alex Harui <[email protected]> Authored: Fri Oct 16 15:34:05 2015 -0700 Committer: Alex Harui <[email protected]> Committed: Fri Oct 16 15:34:05 2015 -0700 ---------------------------------------------------------------------- build.xml | 22 ++++++ .../internal/scopes/ASProjectScope.java | 6 +- externs/js/src/Vector-template.as | 81 ++++++++++++++++++++ externs/js/src/Vector.as | 81 ++++++++++++++++++++ 4 files changed, 188 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/9a0f6561/build.xml ---------------------------------------------------------------------- diff --git a/build.xml b/build.xml index 15a49c6..c47e830 100644 --- a/build.xml +++ b/build.xml @@ -627,6 +627,28 @@ <arg value="-load-config=externs/js/js-compile-config.xml" /> </java> <copy file="${basedir}/externs/js/src/AS3.as" tofile="${basedir}/externs/js/out/as/classes/AS3.as" /> + <mkdir dir="${basedir}/externs/js/out/as/classes/__AS3__/vec" /> + <copy file="${basedir}/externs/js/src/Vector.as" tofile="${basedir}/externs/js/out/as/classes/__AS3__/vec/Vector.as" /> + <copy file="${basedir}/externs/js/src/Vector-template.as" tofile="${basedir}/externs/js/out/as/classes/__AS3__/vec/Vector$object.as" /> + <replace file="${basedir}/externs/js/out/as/classes/__AS3__/vec/Vector$object.as" > + <replacefilter token="$t" value="$object" /> + <replacefilter token=":T" value=":Object" /> + </replace> + <copy file="${basedir}/externs/js/src/Vector-template.as" tofile="${basedir}/externs/js/out/as/classes/__AS3__/vec/Vector$double.as" /> + <replace file="${basedir}/externs/js/out/as/classes/__AS3__/vec/Vector$double.as" > + <replacefilter token="$t" value="$double" /> + <replacefilter token=":T" value=":Number" /> + </replace> + <copy file="${basedir}/externs/js/src/Vector-template.as" tofile="${basedir}/externs/js/out/as/classes/__AS3__/vec/Vector$int.as" /> + <replace file="${basedir}/externs/js/out/as/classes/__AS3__/vec/Vector$int.as" > + <replacefilter token="$t" value="$int" /> + <replacefilter token=":T" value=":int" /> + </replace> + <copy file="${basedir}/externs/js/src/Vector-template.as" tofile="${basedir}/externs/js/out/as/classes/__AS3__/vec/Vector$uint.as" /> + <replace file="${basedir}/externs/js/out/as/classes/__AS3__/vec/Vector$uint.as" > + <replacefilter token="$t" value="$uint" /> + <replacefilter token=":T" value=":uint" /> + </replace> <java jar="${basedir}/compiler/generated/dist/sdk/lib/falcon-compc.jar" fork="true" failonerror="true"> <arg value="+flexlib=externs" /> http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/9a0f6561/compiler/src/org/apache/flex/compiler/internal/scopes/ASProjectScope.java ---------------------------------------------------------------------- diff --git a/compiler/src/org/apache/flex/compiler/internal/scopes/ASProjectScope.java b/compiler/src/org/apache/flex/compiler/internal/scopes/ASProjectScope.java index f2195be..745de15 100644 --- a/compiler/src/org/apache/flex/compiler/internal/scopes/ASProjectScope.java +++ b/compiler/src/org/apache/flex/compiler/internal/scopes/ASProjectScope.java @@ -232,6 +232,7 @@ public class ASProjectScope extends ASScopeBase private final ReadWriteLock readWriteLock; private final Lock readLock; private final Lock writeLock; + private final Lock newVectorClassLock; /** * The value is a WeakReference to a ICompilationUnit, as the @@ -294,6 +295,7 @@ public class ASProjectScope extends ASScopeBase readWriteLock = new ReentrantReadWriteLock(); readLock = readWriteLock.readLock(); writeLock = readWriteLock.writeLock(); + newVectorClassLock = new ReentrantReadWriteLock().writeLock(); qnameToShadowedDefinitions = null; @@ -1448,7 +1450,7 @@ public class ASProjectScope extends ASScopeBase // No dice, looks like we might have to create the // vector class. - writeLock.lock(); + newVectorClassLock.lock(); try { // Now that we have the write lock, make sure nobody created @@ -1513,7 +1515,7 @@ public class ASProjectScope extends ASScopeBase } finally { - writeLock.unlock(); + newVectorClassLock.unlock(); } } http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/9a0f6561/externs/js/src/Vector-template.as ---------------------------------------------------------------------- diff --git a/externs/js/src/Vector-template.as b/externs/js/src/Vector-template.as new file mode 100644 index 0000000..e8e65b8 --- /dev/null +++ b/externs/js/src/Vector-template.as @@ -0,0 +1,81 @@ +//////////////////////////////////////////////////////////////////////////////// +// +// 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 __AS3__.vec +{ + +/** + * The compiler appears to expect these internal implementations + * + * @langversion 3.0 + * @playerversion Flash 9 + * @playerversion AIR 1.1 + * @productversion Flex 3 + */ +internal class Vector$t +{ + public function Vector$t(length:uint = 0, fixed:Boolean = false) {} + + public var fixed:Boolean; + + public var length:uint; + + public function concat(...args):Vector$t { return null } + + public function every(callback:Function, thisObject:Object):Boolean { return false } + + public function filter(callback:Function, thisObject:Object = null):Vector$t { return null } + + public function forEach(callback:Function, thisObject:Object = null):void {} + + public function indexOf(searchElement:T, fromIndex:int = 0):int { return -1 } + + public function insertAt(index:int, element:T):void {} + + public function join(sep:String = ","):String { return null } + + public function lastIndexOf(searchElement:T, fromIndex:int = 0x7fffffff):int { return -1 } + + public function map(callback:Function, thisObject:Object = null):Vector$t { return null } + + public function pop():T { return null } + + public function push(... args):uint { return 0 } + + public function removeAt(index:int):T { return null } + + public function reverse():Vector$t { return null } + + public function shift():T { return null } + + public function slice(startIndex:int = 0, endIndex:int = 16777215):Vector$t { return null } + + public function some(callback:Function, thisObject:Object = null):Boolean { return false } + + public function sort(sortBehavior:Object):Vector$t { return null } + + public function splice(startIndex:int, deleteCount:uint = 4294967295, ... items):Vector$t { return null } + + override public function toLocaleString():String { return null } + + public function toString():String { return null } + + public function unshift(... args):uint { return 0 } +} +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/9a0f6561/externs/js/src/Vector.as ---------------------------------------------------------------------- diff --git a/externs/js/src/Vector.as b/externs/js/src/Vector.as new file mode 100644 index 0000000..a5d82f1 --- /dev/null +++ b/externs/js/src/Vector.as @@ -0,0 +1,81 @@ +//////////////////////////////////////////////////////////////////////////////// +// +// 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 __AS3__.vec +{ + +/** + * This is a special case for Vector + * + * @langversion 3.0 + * @playerversion Flash 9 + * @playerversion AIR 1.1 + * @productversion Flex 3 + */ +public class Vector +{ + public function Vector(length:uint = 0, fixed:Boolean = false) {} + + public var fixed:Boolean; + + public var length:uint; + + public function concat(...args):Vector { return null } + + public function every(callback:Function, thisObject:Object):Boolean { return false } + + public function filter(callback:Function, thisObject:Object = null):Vector { return null } + + public function forEach(callback:Function, thisObject:Object = null):void {} + + public function indexOf(searchElement:Object, fromIndex:int = 0):int { return -1 } + + public function insertAt(index:int, element:Object):void {} + + public function join(sep:String = ","):String { return null } + + public function lastIndexOf(searchElement:Object, fromIndex:int = 0x7fffffff):int { return -1 } + + public function map(callback:Function, thisObject:Object = null):Vector { return null } + + public function pop():Object { return null } + + public function push(... args):uint { return 0 } + + public function removeAt(index:int):Object { return null } + + public function reverse():Vector { return null } + + public function shift():Object { return null } + + public function slice(startIndex:int = 0, endIndex:int = 16777215):Vector { return null } + + public function some(callback:Function, thisObject:Object = null):Boolean { return false } + + public function sort(sortBehavior:Object):Vector { return null } + + public function splice(startIndex:int, deleteCount:uint = 4294967295, ... items):Vector { return null } + + override public function toLocaleString():String { return null } + + public function toString():String { return null } + + public function unshift(... args):uint { return 0 } +} +} \ No newline at end of file
