Skip to content

Commit 84962f2

Browse files
committed
Merge pull request #992 from wise0704/IntrinsicAS3
AS3 Intrinsic Library Improvement
2 parents 27296c6 + 17beb50 commit 84962f2

File tree

3 files changed

+91
-23
lines changed

3 files changed

+91
-23
lines changed

External/Plugins/AS3Context/Context.cs

Lines changed: 8 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -334,23 +334,14 @@ public override void BuildClassPath()
334334
}
335335

336336
// intrinsics (deprecated, excepted for FP10 Vector.<T>)
337-
string fp9cp = as3settings.AS3ClassPath + S + "FP9";
338-
AddPath(PathHelper.ResolvePath(fp9cp));
339-
if (majorVersion > 9)
337+
// add from the highest version number (FP11 > FP10 > FP9)
338+
string fp = as3settings.AS3ClassPath + S + "FP";
339+
for (int i = majorVersion; i >= 9; i--)
340340
{
341-
for (int i = 10; i <= majorVersion; i++)
342-
{
343-
string fp10cp = as3settings.AS3ClassPath + S + "FP" + i;
344-
AddPath(PathHelper.ResolvePath(fp10cp));
345-
for (int j = 1; j <= minorVersion; j++)
346-
{
347-
string fp101cp = as3settings.AS3ClassPath + S + "FP" + majorVersion + "." + minorVersion;
348-
AddPath(PathHelper.ResolvePath(fp101cp));
349-
}
350-
}
341+
AddPath(PathHelper.ResolvePath(fp + i));
351342
}
352343

353-
// add external pathes
344+
// add external paths
354345
List<PathModel> initCP = classPath;
355346
classPath = new List<PathModel>();
356347
if (contextSetup.Classpath != null)
@@ -361,20 +352,20 @@ public override void BuildClassPath()
361352

362353
// add library
363354
AddPath(PathHelper.LibraryDir + S + "AS3" + S + "classes");
364-
// add user pathes from settings
355+
// add user paths from settings
365356
if (settings.UserClasspath != null && settings.UserClasspath.Length > 0)
366357
{
367358
foreach (string cpath in settings.UserClasspath) AddPath(cpath.Trim());
368359
}
369360

370-
// add initial pathes
361+
// add initial paths
371362
foreach (PathModel mpath in initCP) AddPath(mpath);
372363

373364
// parse top-level elements
374365
InitTopLevelElements();
375366
if (cFile != null) UpdateTopLevelElements();
376367

377-
// add current temporaty path
368+
// add current temporary path
378369
if (temporaryPath != null)
379370
{
380371
string tempPath = temporaryPath;

FlashDevelop/Bin/Debug/Library/AS3/intrinsic/FP11/Vector.as

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,6 @@ package
2727
/// [FP10] Searches for an item in the Vector and returns the index position of the item.
2828
public function indexOf (searchElement:T, fromIndex:int = 0) : int;
2929

30-
/// [FP19] Insert a single element into the Vector.
31-
public function insertAt (index:int, element:T) : void;
32-
3330
/// [FP10] Converts the elements in the Vector to strings.
3431
public function join (sep:String = ",") : String;
3532

@@ -45,9 +42,6 @@ package
4542
/// [FP10] Adds one or more elements to the end of the Vector and returns the new length of the Vector.
4643
public function push (...args) : uint;
4744

48-
/// [FP19] Remove a single element from the Vector.
49-
public function removeAt (index:int) : T;
50-
5145
/// [FP10] Reverses the order of the elements in the Vector.
5246
public function reverse () : Vector.<T>;
5347

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
package
2+
{
3+
/// The Vector class lets you access and manipulate a vector - an array whose elements all have the same data type.
4+
public class Vector.<T>
5+
{
6+
/// [FP10] The range of valid indices available in the Vector.
7+
public function get length () : int;
8+
public function set length (value:int) : void;
9+
10+
/// [FP10] Indicates whether the length property of the Vector can be changed.
11+
public function get fixed () : Boolean;
12+
public function set fixed (value:int) void;
13+
14+
/// [FP10] Creates a Vector with the specified base type.
15+
public function Vector (length:uint = 0, fixed:Boolean = false);
16+
17+
/// [FP10] Concatenates the elements specified in the parameters.
18+
public function concat (...args) : Vector.<T>;
19+
20+
/// [FP10] Executes a test function on each item in the Vector until an item is reached that returns false for the specified function.
21+
public function every (callback:Function, thisObject:Object = null) : Boolean;
22+
23+
/// [FP10] Executes a test function on each item in the Vector and returns a new Vector containing all items that return true for the specified function.
24+
public function filter (callback:Function, thisObject:Object = null) : Vector.<T>;
25+
26+
/// [FP10] Executes a function on each item in the Vector.
27+
public function forEach (callback:Function, thisObject:Object = null) : void;
28+
29+
/// [FP10] Searches for an item in the Vector and returns the index position of the item.
30+
public function indexOf (searchElement:T, fromIndex:int = 0) : int;
31+
32+
/// [FP19] Insert a single element into the Vector.
33+
public function insertAt (index:int, element:T) : void;
34+
35+
/// [FP10] Converts the elements in the Vector to strings.
36+
public function join (sep:String = ",") : String;
37+
38+
/// [FP10] Searches for an item in the Vector, working backward from the specified index position, and returns the index position of the matching item.
39+
public function lastIndexOf (searchElement:T, fromIndex:int = 0x7fffffff) : int;
40+
41+
/// [FP10] Executes a function on each item in the Vector, and returns a new Vector of items corresponding to the results of calling the function on each item in this Vector.
42+
public function map (callback:Function, thisObject:Object = null) : Vector.<T>;
43+
44+
/// [FP10] Removes the last element from the Vector and returns that element.
45+
public function pop () : T;
46+
47+
/// [FP10] Adds one or more elements to the end of the Vector and returns the new length of the Vector.
48+
public function push (...args) : uint;
49+
50+
/// [FP19] Remove a single element from the Vector.
51+
public function removeAt (index:int) : T;
52+
53+
/// [FP10] Reverses the order of the elements in the Vector.
54+
public function reverse () : Vector.<T>;
55+
56+
/// [FP10] Removes the first element from the Vector and returns that element.
57+
public function shift () : T;
58+
59+
/// [FP10] Returns a new Vector that consists of a range of elements from the original Vector.
60+
public function slice (startIndex:int = 0, endIndex:int = 16777215) : Vector.<T>;
61+
62+
/// [FP10] Executes a test function on each item in the Vector until an item is reached that returns true.
63+
public function some (callback:Function, thisObject:Object = null) : Boolean;
64+
65+
/// [FP10] Sorts the elements in the Vector.
66+
public function sort (compareFunction:Function) : Vector.<T>;
67+
68+
/// [FP10] Adds elements to and removes elements from the Vector.
69+
public function splice (startIndex:int, deleteCount:uint, ...items) : Vector.<T>;
70+
71+
/// [FP10] Returns a string that represents the elements in the Vector.
72+
public function toString () : String;
73+
74+
/// [FP10] Returns a string that represents the elements in the specified Vector.
75+
public function toLocaleString () : String;
76+
77+
/// [FP10] Adds one or more elements to the beginning of the Vector and returns the new length of the Vector.
78+
public function unshift (...args) : uint;
79+
80+
}
81+
82+
}
83+

0 commit comments

Comments
 (0)