tests: Consolidate all of the type variants of each test into one test per function.

This commit is contained in:
David Wendt 2021-07-08 19:53:52 -04:00 committed by kmeisthax
parent 6b78e86ddc
commit e3ad30a0f7
326 changed files with 4311 additions and 4001 deletions

View File

@ -632,78 +632,17 @@ swf_tests! {
(as3_simplebutton_symbolclass, "avm2/simplebutton_symbolclass", 3), (as3_simplebutton_symbolclass, "avm2/simplebutton_symbolclass", 3),
(as3_vector_int_access, "avm2/vector_int_access", 1), (as3_vector_int_access, "avm2/vector_int_access", 1),
(as3_vector_int_delete, "avm2/vector_int_delete", 1), (as3_vector_int_delete, "avm2/vector_int_delete", 1),
(as3_vector_int_coercion, "avm2/vector_int_coercion", 1), (as3_vector_holes, "avm2/vector_holes", 1),
(as3_vector_int_holes, "avm2/vector_int_holes", 1), (as3_vector_coercion, "avm2/vector_coercion", 1),
(as3_vector_number_coercion, "avm2/vector_number_coercion", 1), (as3_vector_concat, "avm2/vector_concat", 1),
(as3_vector_number_holes, "avm2/vector_number_holes", 1), (as3_vector_join, "avm2/vector_join", 1),
(as3_vector_uint_coercion, "avm2/vector_uint_coercion", 1), (as3_vector_every, "avm2/vector_every", 1),
(as3_vector_uint_holes, "avm2/vector_uint_holes", 1), (as3_vector_filter, "avm2/vector_filter", 1),
(as3_vector_string_coercion, "avm2/vector_string_coercion", 1), (as3_vector_indexof, "avm2/vector_indexof", 1),
(as3_vector_string_holes, "avm2/vector_string_holes", 1), (as3_vector_lastindexof, "avm2/vector_lastindexof", 1),
(as3_vector_bool_coercion, "avm2/vector_bool_coercion", 1), (as3_vector_map, "avm2/vector_map", 1),
(as3_vector_bool_holes, "avm2/vector_bool_holes", 1), (as3_vector_pushpop, "avm2/vector_pushpop", 1),
(as3_vector_es3class_coercion, "avm2/vector_es3class_coercion", 1), (as3_vector_shiftunshift, "avm2/vector_shiftunshift", 1),
(as3_vector_es4class_coercion, "avm2/vector_es4class_coercion", 1),
(as3_vector_int_concat, "avm2/vector_int_concat", 1),
(as3_vector_uint_concat, "avm2/vector_uint_concat", 1),
(as3_vector_number_concat, "avm2/vector_number_concat", 1),
(as3_vector_string_concat, "avm2/vector_string_concat", 1),
(as3_vector_bool_concat, "avm2/vector_bool_concat", 1),
(as3_vector_es4class_concat, "avm2/vector_es4class_concat", 1),
(as3_vector_es4interface_concat, "avm2/vector_es4interface_concat", 1),
(as3_vector_vector_coercion, "avm2/vector_vector_coercion", 1),
(as3_vector_vector_concat, "avm2/vector_vector_concat", 1),
(as3_vector_int_join, "avm2/vector_int_join", 1),
(as3_vector_uint_join, "avm2/vector_uint_join", 1),
(as3_vector_number_join, "avm2/vector_number_join", 1),
(as3_vector_string_join, "avm2/vector_string_join", 1),
(as3_vector_bool_join, "avm2/vector_bool_join", 1),
(as3_vector_es4class_join, "avm2/vector_es4class_join", 1),
(as3_vector_es4interface_join, "avm2/vector_es4interface_join", 1),
(as3_vector_vector_join, "avm2/vector_vector_join", 1),
(as3_vector_int_every, "avm2/vector_int_every", 1),
(as3_vector_uint_every, "avm2/vector_uint_every", 1),
(as3_vector_number_every, "avm2/vector_number_every", 1),
(as3_vector_string_every, "avm2/vector_string_every", 1),
(as3_vector_bool_every, "avm2/vector_bool_every", 1),
(as3_vector_es4class_every, "avm2/vector_es4class_every", 1),
(as3_vector_es4interface_every, "avm2/vector_es4interface_every", 1),
(as3_vector_vector_every, "avm2/vector_vector_every", 1),
(as3_vector_int_filter, "avm2/vector_int_filter", 1),
(as3_vector_uint_filter, "avm2/vector_uint_filter", 1),
(as3_vector_number_filter, "avm2/vector_number_filter", 1),
(as3_vector_string_filter, "avm2/vector_string_filter", 1),
(as3_vector_bool_filter, "avm2/vector_bool_filter", 1),
(as3_vector_es4class_filter, "avm2/vector_es4class_filter", 1),
(as3_vector_es4interface_filter, "avm2/vector_es4interface_filter", 1),
(as3_vector_int_indexof, "avm2/vector_int_indexof", 1),
(as3_vector_uint_indexof, "avm2/vector_uint_indexof", 1),
(as3_vector_number_indexof, "avm2/vector_number_indexof", 1),
(as3_vector_string_indexof, "avm2/vector_string_indexof", 1),
(as3_vector_bool_indexof, "avm2/vector_bool_indexof", 1),
(as3_vector_es4class_indexof, "avm2/vector_es4class_indexof", 1),
(as3_vector_vector_indexof, "avm2/vector_vector_indexof", 1),
(as3_vector_int_lastindexof, "avm2/vector_int_lastindexof", 1),
(as3_vector_uint_lastindexof, "avm2/vector_uint_lastindexof", 1),
(as3_vector_number_lastindexof, "avm2/vector_number_lastindexof", 1),
(as3_vector_string_lastindexof, "avm2/vector_string_lastindexof", 1),
(as3_vector_bool_lastindexof, "avm2/vector_bool_lastindexof", 1),
(as3_vector_es4class_lastindexof, "avm2/vector_es4class_lastindexof", 1),
(as3_vector_vector_lastindexof, "avm2/vector_vector_lastindexof", 1),
(as3_vector_int_map, "avm2/vector_int_map", 1),
(as3_vector_uint_map, "avm2/vector_uint_map", 1),
(as3_vector_number_map, "avm2/vector_number_map", 1),
(as3_vector_string_map, "avm2/vector_string_map", 1),
(as3_vector_bool_map, "avm2/vector_bool_map", 1),
(as3_vector_es4class_map, "avm2/vector_es4class_map", 1),
(as3_vector_vector_map, "avm2/vector_vector_map", 1),
(as3_vector_int_pushpop, "avm2/vector_int_pushpop", 1),
(as3_vector_uint_pushpop, "avm2/vector_uint_pushpop", 1),
(as3_vector_number_pushpop, "avm2/vector_number_pushpop", 1),
(as3_vector_string_pushpop, "avm2/vector_string_pushpop", 1),
(as3_vector_bool_pushpop, "avm2/vector_bool_pushpop", 1),
(as3_vector_es4class_pushpop, "avm2/vector_es4class_pushpop", 1),
(as3_vector_vector_pushpop, "avm2/vector_vector_pushpop", 1),
} }
// TODO: These tests have some inaccuracies currently, so we use approx_eq to test that numeric values are close enough. // TODO: These tests have some inaccuracies currently, so we use approx_eq to test that numeric values are close enough.

View File

@ -1,24 +0,0 @@
package {
public class Test {
}
}
trace("/// var a: Vector.<Boolean> = new <Boolean>[1,2,3,4];");
var a:Vector.<Boolean> = new <Boolean>[1,2,3,4];
trace("/// a[0] = 1;");
a[0] = 1;
trace("/// a[1] = NaN;");
a[1] = NaN;
trace("/// a[2] = \"false\";");
a[2] = "false";
trace("/// a[3] = true;");
a[3] = true;
trace(a[0]);
trace(a[1]);
trace(a[2]);
trace(a[3]);

View File

@ -1,9 +0,0 @@
/// var a: Vector.<Boolean> = new <Boolean>[1,2,3,4];
/// a[0] = 1;
/// a[1] = NaN;
/// a[2] = "false";
/// a[3] = true;
true
false
true
true

View File

@ -1,22 +0,0 @@
package {
public class Test {
}
}
function trace_vec(v) {
for (var i = 0; i < v.length; i += 1) {
trace(v[i]);
}
}
trace("/// var a: Vector.<Boolean> = new <Boolean>[true, false];");
var a:Vector.<Boolean> = new <Boolean>[true, false];
trace("/// var b: Vector.<Boolean> = new <Boolean>[false, true, false];");
var b:Vector.<Boolean> = new <Boolean>[false, true, false];
trace("/// var c = a.concat(b);");
var c = a.concat(b);
trace("/// (contents of c...)");
trace_vec(c);

View File

@ -1,9 +0,0 @@
/// var a: Vector.<Boolean> = new <Boolean>[true, false];
/// var b: Vector.<Boolean> = new <Boolean>[false, true, false];
/// var c = a.concat(b);
/// (contents of c...)
true
false
false
true
false

View File

@ -1,22 +0,0 @@
package {
public class Test {
}
}
trace("/// var a: Vector.<Boolean> = new <Boolean>[true, false];");
var a:Vector.<Boolean> = new <Boolean>[true, false];
trace("/// var b: Vector.<Boolean> = new <Boolean>[true, true];");
var b:Vector.<Boolean> = new <Boolean>[true, true];
trace("/// a.every(function(v) { return v; });");
trace(a.every(function (v) { return v; }));
trace("/// a.every(function(v) { return true; });");
trace(a.every(function (v) { return true; }));
trace("/// b.every(function(v) { return v; });");
trace(b.every(function (v) { return v; }));
trace("/// b.every(function(v) { return true; });");
trace(b.every(function (v) { return true; }));

View File

@ -1,10 +0,0 @@
/// var a: Vector.<Boolean> = new <Boolean>[true, false];
/// var b: Vector.<Boolean> = new <Boolean>[true, true];
/// a.every(function(v) { return v; });
false
/// a.every(function(v) { return true; });
true
/// b.every(function(v) { return v; });
true
/// b.every(function(v) { return true; });
true

View File

@ -1,29 +0,0 @@
package {
public class Test {
}
}
function trace_vector(v: Vector.<*>) {
trace(v.length, "elements");
for (var i = 0; i < v.length; i += 1) {
trace(v[i]);
}
}
trace("/// var a: Vector.<Boolean> = new <Boolean>[true, false];");
var a:Vector.<Boolean> = new <Boolean>[true, false];
trace("/// var b: Vector.<Boolean> = new <Boolean>[true, true];");
var b:Vector.<Boolean> = new <Boolean>[true, true];
trace("/// a.filter(function(v) { return v; });");
trace_vector(a.filter(function (v) { return v; }));
trace("/// a.filter(function(v) { return !v; });");
trace_vector(a.filter(function (v) { return !v; }));
trace("/// b.filter(function(v) { return v; });");
trace_vector(b.filter(function (v) { return v; }));
trace("/// b.filter(function(v) { return !v; });");
trace_vector(b.filter(function (v) { return !v; }));

View File

@ -1,14 +0,0 @@
/// var a: Vector.<Boolean> = new <Boolean>[true, false];
/// var b: Vector.<Boolean> = new <Boolean>[true, true];
/// a.filter(function(v) { return v; });
1 elements
true
/// a.filter(function(v) { return !v; });
1 elements
false
/// b.filter(function(v) { return v; });
2 elements
true
true
/// b.filter(function(v) { return !v; });
0 elements

View File

@ -1,13 +0,0 @@
package {
public class Test {
}
}
trace("/// var a: Vector.<Boolean> = new <Boolean>[];");
var a:Vector.<Boolean> = new <Boolean>[];
trace("/// a.length = 2;");
a.length = 2;
trace(a[0]);
trace(a[1]);

View File

@ -1,4 +0,0 @@
/// var a: Vector.<Boolean> = new <Boolean>[];
/// a.length = 2;
null
null

View File

@ -1,22 +0,0 @@
package {
public class Test {
}
}
trace("/// var a: Vector.<Boolean> = new <Boolean>[true, false];");
var a:Vector.<Boolean> = new <Boolean>[true, false];
trace("/// var b: Vector.<Boolean> = new <Boolean>[true, true];");
var b:Vector.<Boolean> = new <Boolean>[true, true];
trace("/// a.indexOf(true);");
trace(a.indexOf(true));
trace("/// a.indexOf(false));");
trace(a.indexOf(false));
trace("/// b.indexOf(true);");
trace(b.indexOf(true));
trace("/// b.indexOf(false);");
trace(b.indexOf(false));

View File

@ -1,10 +0,0 @@
/// var a: Vector.<Boolean> = new <Boolean>[true, false];
/// var b: Vector.<Boolean> = new <Boolean>[true, true];
/// a.indexOf(true);
0
/// a.indexOf(false));
1
/// b.indexOf(true);
0
/// b.indexOf(false);
-1

View File

@ -1,16 +0,0 @@
package {
public class Test {
}
}
trace("/// var a: Vector.<Boolean> = new <Boolean>[true, false];");
var a:Vector.<Boolean> = new <Boolean>[true, false];
trace("/// var b: Vector.<Boolean> = new <Boolean>[false, true, false];");
var b:Vector.<Boolean> = new <Boolean>[false, true, false];
trace("/// a.join('...');");
trace(a.join("..."));
trace("/// b.join('...');");
trace(b.join("..."));

View File

@ -1,6 +0,0 @@
/// var a: Vector.<Boolean> = new <Boolean>[true, false];
/// var b: Vector.<Boolean> = new <Boolean>[false, true, false];
/// a.join('...');
true...false
/// b.join('...');
false...true...false

View File

@ -1,46 +0,0 @@
package {
public class Test {
}
}
trace("/// var a: Vector.<Boolean> = new <Boolean>[true, false];");
var a:Vector.<Boolean> = new <Boolean>[true, false];
trace("/// var b: Vector.<Boolean> = new <Boolean>[true, true];");
var b:Vector.<Boolean> = new <Boolean>[true, true];
trace("/// a.lastIndexOf(true);");
trace(a.lastIndexOf(true));
trace("/// a.lastIndexOf(false));");
trace(a.lastIndexOf(false));
trace("/// b.lastIndexOf(true);");
trace(b.lastIndexOf(true));
trace("/// b.lastIndexOf(false);");
trace(b.lastIndexOf(false));
trace("/// a.lastIndexOf(true, 1);");
trace(a.lastIndexOf(true, 1));
trace("/// a.lastIndexOf(false, 1));");
trace(a.lastIndexOf(false, 1));
trace("/// b.lastIndexOf(true, 1);");
trace(b.lastIndexOf(true, 1));
trace("/// b.lastIndexOf(false, 1);");
trace(b.lastIndexOf(false, 1));
trace("/// a.lastIndexOf(true, 0);");
trace(a.lastIndexOf(true, 0));
trace("/// a.lastIndexOf(false, 0));");
trace(a.lastIndexOf(false, 0));
trace("/// b.lastIndexOf(true, 0);");
trace(b.lastIndexOf(true, 0));
trace("/// b.lastIndexOf(false, 0);");
trace(b.lastIndexOf(false, 0));

View File

@ -1,26 +0,0 @@
/// var a: Vector.<Boolean> = new <Boolean>[true, false];
/// var b: Vector.<Boolean> = new <Boolean>[true, true];
/// a.lastIndexOf(true);
0
/// a.lastIndexOf(false));
1
/// b.lastIndexOf(true);
1
/// b.lastIndexOf(false);
-1
/// a.lastIndexOf(true, 1);
0
/// a.lastIndexOf(false, 1));
1
/// b.lastIndexOf(true, 1);
1
/// b.lastIndexOf(false, 1);
-1
/// a.lastIndexOf(true, 0);
0
/// a.lastIndexOf(false, 0));
-1
/// b.lastIndexOf(true, 0);
0
/// b.lastIndexOf(false, 0);
-1

View File

@ -1,29 +0,0 @@
package {
public class Test {
}
}
function trace_vector(v: Vector.<*>) {
trace(v.length, "elements");
for (var i = 0; i < v.length; i += 1) {
trace(v[i]);
}
}
trace("/// var a: Vector.<Boolean> = new <Boolean>[true, false];");
var a:Vector.<Boolean> = new <Boolean>[true, false];
trace("/// var b: Vector.<Boolean> = new <Boolean>[true, true];");
var b:Vector.<Boolean> = new <Boolean>[true, true];
trace("/// a.map(function(v) { return v; });");
trace_vector(a.map(function (v) { return v; }));
trace("/// a.map(function(v) { return !v; });");
trace_vector(a.map(function (v) { return !v; }));
trace("/// b.map(function(v) { return v; });");
trace_vector(b.map(function (v) { return v; }));
trace("/// b.map(function(v) { return !v; });");
trace_vector(b.map(function (v) { return !v; }));

View File

@ -1,18 +0,0 @@
/// var a: Vector.<Boolean> = new <Boolean>[true, false];
/// var b: Vector.<Boolean> = new <Boolean>[true, true];
/// a.map(function(v) { return v; });
2 elements
true
false
/// a.map(function(v) { return !v; });
2 elements
false
true
/// b.map(function(v) { return v; });
2 elements
true
true
/// b.map(function(v) { return !v; });
2 elements
false
false

View File

@ -1,38 +0,0 @@
package {
public class Test {
}
}
function trace_vector(v: Vector.<*>) {
trace(v.length, "elements");
for (var i = 0; i < v.length; i += 1) {
trace(v[i]);
}
}
trace("/// var a: Vector.<Boolean> = new <Boolean>[true, false];");
var a:Vector.<Boolean> = new <Boolean>[true, false];
trace("/// var b: Vector.<Boolean> = new <Boolean>[false, true, false];");
var b:Vector.<Boolean> = new <Boolean>[false, true, false];
trace("/// a.pop();");
trace(a.pop());
trace("/// a.pop();");
trace(a.pop());
trace("/// a.pop();");
trace(a.pop());
trace("/// a.push(0, \"true\", -1, 3.5, \"false\", false, true);");
trace(a.push(0, "true", -1, 3.5, "false", false, true));
trace("/// (contents of a...)");
trace_vector(a);
trace("/// b.push(0, \"true\", -1, 3.5, \"false\", false, true);");
trace(b.push(0, "true", -1, 3.5, "false", false, true));
trace("/// (contents of b...)");
trace_vector(b);

View File

@ -1,33 +0,0 @@
/// var a: Vector.<Boolean> = new <Boolean>[true, false];
/// var b: Vector.<Boolean> = new <Boolean>[false, true, false];
/// a.pop();
false
/// a.pop();
true
/// a.pop();
undefined
/// a.push(0, "true", -1, 3.5, "false", false, true);
7
/// (contents of a...)
7 elements
false
true
true
true
true
false
true
/// b.push(0, "true", -1, 3.5, "false", false, true);
10
/// (contents of b...)
10 elements
false
true
false
false
true
true
true
true
false
true

View File

@ -0,0 +1,174 @@
package {
public class Test {
}
}
trace("/// var a_bool: Vector.<Boolean> = new <Boolean>[1,2,3,4];");
var a_bool:Vector.<Boolean> = new <Boolean>[1,2,3,4];
trace("/// a_bool[0] = 1;");
a_bool[0] = 1;
trace("/// a_bool[1] = NaN;");
a_bool[1] = NaN;
trace("/// a_bool[2] = \"false\";");
a_bool[2] = "false";
trace("/// a_bool[3] = true;");
a_bool[3] = true;
trace(a_bool[0]);
trace(a_bool[1]);
trace(a_bool[2]);
trace(a_bool[3]);
function LegacyClass() {
}
function LegacySubclass() {
}
LegacySubclass.prototype = new LegacyClass();
trace("/// var a_legacy: Vector.<Object> = new <Object>[];");
var a_legacy:Vector.<Object> = new <Object>[];
trace("/// a_legacy.length = 2;");
a_legacy.length = 2;
trace(a_legacy[0]);
trace(a_legacy[1]);
trace("/// a_legacy[0] = new LegacyClass();");
a_legacy[0] = new LegacyClass();
trace("/// a_legacy[1] = new LegacySubclass();");
a_legacy[1] = new LegacySubclass();
trace(a_legacy[0]);
trace(a_legacy[1]);
class Superclass {
}
class Subclass extends Superclass {
}
trace("/// var a_class: Vector.<Superclass> = new <Superclass>[];");
var a_class:Vector.<Superclass> = new <Superclass>[];
trace("/// a_class.length = 2;");
a_class.length = 2;
trace(a_class[0]);
trace(a_class[1]);
trace("/// a_class[0] = new Superclass();");
a_class[0] = new Superclass();
trace("/// a_class[1] = new Subclass();");
a_class[1] = new Subclass();
trace(a_class[0]);
trace(a_class[1]);
trace("/// var a_int: Vector.<int> = new <int>[1,2];");
var a_int:Vector.<int> = new <int>[1,2];
trace("/// a_int[0] = \"5\";");
a_int[0] = "5";
trace("/// a_int[1] = \"not a number\";");
a_int[1] = "not a number";
trace(a_int[0]);
trace(a_int[1]);
trace("/// var a_number: Vector.<Number> = new <Number>[1,2,3,4];");
var a_number:Vector.<Number> = new <Number>[1,2,3,4];
trace("/// a_number[0] = \"5\";");
a_number[0] = "5";
trace("/// a_number[1] = \"NaN\";");
a_number[1] = "NaN";
trace("/// a_number[2] = -5;");
a_number[2] = -5;
trace("/// a_number[3] = true;");
a_number[3] = true;
trace(a_number[0]);
trace(a_number[1]);
trace(a_number[2]);
trace(a_number[3]);
trace("/// var a_string: Vector.<String> = new <String>[1,2,3,4];");
var a_string:Vector.<String> = new <String>[1,2,3,4];
trace("/// a_string[0] = 5;");
a_string[0] = 5;
trace("/// a_string[1] = NaN;");
a_string[1] = NaN;
trace("/// a_string[2] = \"actually imma string\";");
a_string[2] = "actually imma string";
trace("/// a_string[3] = true;");
a_string[3] = true;
trace(a_string[0]);
trace(a_string[1]);
trace(a_string[2]);
trace(a_string[3]);
trace("/// var a_uint: Vector.<uint> = new <uint>[1,2,3,4];");
var a_uint:Vector.<uint> = new <uint>[1,2,3,4];
trace("/// a_uint[0] = \"5\";");
a_uint[0] = "5";
trace("/// a_uint[1] = \"not a number\";");
a_uint[1] = "not a number";
trace("/// a_uint[2] = -5;");
a_uint[2] = -5;
trace("/// a_uint[3] = false;");
a_uint[3] = false;
trace(a_uint[0]);
trace(a_uint[1]);
trace(a_uint[2]);
trace(a_uint[3]);
function trace_vector(v) {
for (var i = 0; i < v.length; i += 1) {
trace(v[i]);
}
}
trace("/// var a_vector: Vector.<int> = new <int>[1,2];");
var a_vector:Vector.<int> = new <int>[1,2];
trace("/// var b_vector: Vector.<int> = new <int>[5,16];");
var b_vector:Vector.<int> = new <int>[5,16];
trace("/// var c_vector: Vector.<Vector.<int>> = new <Vector.<int>>[];");
var c_vector:Vector.<Vector.<int>> = new <Vector.<int>>[];
trace("/// c_vector[0] = a_vector;");
c_vector[0] = a_vector;
trace("/// c_vector[1] = b_vector;");
c_vector[1] = b_vector;
trace("/// (contents of c_vector...)");
trace_vector(c_vector);

View File

@ -0,0 +1,65 @@
/// var a_bool: Vector.<Boolean> = new <Boolean>[1,2,3,4];
/// a_bool[0] = 1;
/// a_bool[1] = NaN;
/// a_bool[2] = "false";
/// a_bool[3] = true;
true
false
true
true
/// var a_legacy: Vector.<Object> = new <Object>[];
/// a_legacy.length = 2;
null
null
/// a_legacy[0] = new LegacyClass();
/// a_legacy[1] = new LegacySubclass();
[object Object]
[object Object]
/// var a_class: Vector.<Superclass> = new <Superclass>[];
/// a_class.length = 2;
null
null
/// a_class[0] = new Superclass();
/// a_class[1] = new Subclass();
[object Superclass]
[object Subclass]
/// var a_int: Vector.<int> = new <int>[1,2];
/// a_int[0] = "5";
/// a_int[1] = "not a number";
5
0
/// var a_number: Vector.<Number> = new <Number>[1,2,3,4];
/// a_number[0] = "5";
/// a_number[1] = "NaN";
/// a_number[2] = -5;
/// a_number[3] = true;
5
NaN
-5
1
/// var a_string: Vector.<String> = new <String>[1,2,3,4];
/// a_string[0] = 5;
/// a_string[1] = NaN;
/// a_string[2] = "actually imma string";
/// a_string[3] = true;
5
NaN
actually imma string
true
/// var a_uint: Vector.<uint> = new <uint>[1,2,3,4];
/// a_uint[0] = "5";
/// a_uint[1] = "not a number";
/// a_uint[2] = -5;
/// a_uint[3] = false;
5
0
4294967291
0
/// var a_vector: Vector.<int> = new <int>[1,2];
/// var b_vector: Vector.<int> = new <int>[5,16];
/// var c_vector: Vector.<Vector.<int>> = new <Vector.<int>>[];
/// c_vector[0] = a_vector;
/// c_vector[1] = b_vector;
/// (contents of c_vector...)
1,2
5,16

Binary file not shown.

View File

@ -0,0 +1,150 @@
package {
public class Test {
}
}
function trace_vector(v) {
trace("///length: ", v.length);
for (var i = 0; i < v.length; i += 1) {
trace(v[i]);
}
}
trace("/// var a_bool: Vector.<Boolean> = new <Boolean>[true, false];");
var a_bool:Vector.<Boolean> = new <Boolean>[true, false];
trace("/// var b_bool: Vector.<Boolean> = new <Boolean>[false, true, false];");
var b_bool:Vector.<Boolean> = new <Boolean>[false, true, false];
trace("/// var c_bool = a_bool.concat(b_bool);");
var c_bool = a_bool.concat(b_bool);
trace("/// (contents of c_bool...)");
trace_vector(c_bool);
class Superclass {
}
class Subclass extends Superclass {
}
trace("/// var a_class: Vector.<Superclass> = new <Superclass>[];");
var a_class:Vector.<Superclass> = new <Superclass>[];
trace("/// a_class.length = 2;");
a_class.length = 2;
trace("/// a_class[0] = new Superclass();");
a_class[0] = new Superclass();
trace("/// a_class[1] = new Subclass();");
a_class[1] = new Subclass();
trace("/// var b_class: Vector.<Subclass> = new <Subclass>[];");
var b_class:Vector.<Subclass> = new <Subclass>[];
trace("/// b_class.length = 1;");
b_class.length = 1;
trace("/// b_class[0] = new Subclass();");
b_class[0] = new Subclass();
trace("/// var c_class = a_class.concat(b_class);");
var c_class = a_class.concat(b_class);
trace("/// (contents of c_class...)");
trace_vector(c_class);
interface Interface {
}
class Implementer implements Interface {
}
trace("/// var a_iface: Vector.<Interface> = new <Interface>[];");
var a_iface:Vector.<Interface> = new <Interface>[];
trace("/// a_iface.length = 1;");
a_iface.length = 1;
trace("/// a_iface[0] = new Implementer();");
a_iface[0] = new Implementer();
trace("/// var b_iface: Vector.<Implementer> = new <Implementer>[];");
var b_iface:Vector.<Implementer> = new <Implementer>[];
trace("/// b_iface.length = 1;");
b_iface.length = 1;
trace("/// b_iface[0] = new Implementer();");
b_iface[0] = new Implementer();
trace("/// var c_iface = a_iface.concat(b_iface);");
var c_iface = a_iface.concat(b_iface);
trace("/// (contents of c_iface...)");
trace_vector(c_iface);
trace("/// var a_int: Vector.<int> = new <int>[1,2];");
var a_int:Vector.<int> = new <int>[1,2];
trace("/// var b_int: Vector.<int> = new <int>[5,16];");
var b_int:Vector.<int> = new <int>[5,16];
trace("/// var c_int = a_int.concat(b_int);");
var c_int = a_int.concat(b_int);
trace("/// (contents of c_int...)");
trace_vector(c_int);
trace("/// var a_number: Vector.<Number> = new <Number>[1,2,3,4];");
var a_number:Vector.<Number> = new <Number>[1,2,3,4];
trace("/// var b_number: Vector.<Number> = new <Number>[5, NaN, -5, 0];");
var b_number:Vector.<Number> = new <Number>[5, NaN, -5, 0];
trace("/// var c_number = a_number.concat(b_number);");
var c_number = a_number.concat(b_number);
trace("/// (contents of c_number...)");
trace_vector(c_number);
trace("/// var a_string: Vector.<String> = new <String>[\"a\",\"c\",\"d\",\"f\"];");
var a_string:Vector.<String> = new <String>["a", "c", "d", "f"];
trace("/// var b_string: Vector.<String> = new <String>[\"986\",\"B4\",\"Q\",\"rrr\"];");
var b_string:Vector.<String> = new <String>["986", "B4", "Q", "rrr"];
trace("/// var c_string = a_string.concat(b_string);");
var c_string = a_string.concat(b_string);
trace("/// (contents of c_string...)");
trace_vector(c_string);
trace("/// var a_uint: Vector.<uint> = new <uint>[1,2];");
var a_uint:Vector.<uint> = new <uint>[1,2];
trace("/// var b_uint: Vector.<uint> = new <uint>[5,16];");
var b_uint:Vector.<uint> = new <uint>[5,16];
trace("/// var c_uint = a_uint.concat(b_uint);");
var c_uint = a_uint.concat(b_uint);
trace("/// (contents of c_uint...)");
trace_vector(c_uint);
trace("/// var a_vector:Vector.<Vector.<int>> = new <Vector.<int>>[new <int>[1,2]];");
var a_vector:Vector.<Vector.<int>> = new <Vector.<int>>[new <int>[1,2]];
trace("/// var b_vector:Vector.<Vector.<int>> = new <Vector.<int>>[new <int>[5,16]];");
var b_vector:Vector.<Vector.<int>> = new <Vector.<int>>[new <int>[5,16]];
trace("/// var c_vector = a_vector.concat(b_vector)");
var c_vector = a_vector.concat(b_vector);
trace("/// (contents of c_vector...)");
trace_vector(c_vector);

View File

@ -0,0 +1,85 @@
/// var a_bool: Vector.<Boolean> = new <Boolean>[true, false];
/// var b_bool: Vector.<Boolean> = new <Boolean>[false, true, false];
/// var c_bool = a_bool.concat(b_bool);
/// (contents of c_bool...)
///length: 5
true
false
false
true
false
/// var a_class: Vector.<Superclass> = new <Superclass>[];
/// a_class.length = 2;
/// a_class[0] = new Superclass();
/// a_class[1] = new Subclass();
/// var b_class: Vector.<Subclass> = new <Subclass>[];
/// b_class.length = 1;
/// b_class[0] = new Subclass();
/// var c_class = a_class.concat(b_class);
/// (contents of c_class...)
///length: 3
[object Superclass]
[object Subclass]
[object Subclass]
/// var a_iface: Vector.<Interface> = new <Interface>[];
/// a_iface.length = 1;
/// a_iface[0] = new Implementer();
/// var b_iface: Vector.<Implementer> = new <Implementer>[];
/// b_iface.length = 1;
/// b_iface[0] = new Implementer();
/// var c_iface = a_iface.concat(b_iface);
/// (contents of c_iface...)
///length: 2
[object Implementer]
[object Implementer]
/// var a_int: Vector.<int> = new <int>[1,2];
/// var b_int: Vector.<int> = new <int>[5,16];
/// var c_int = a_int.concat(b_int);
/// (contents of c_int...)
///length: 4
1
2
5
16
/// var a_number: Vector.<Number> = new <Number>[1,2,3,4];
/// var b_number: Vector.<Number> = new <Number>[5, NaN, -5, 0];
/// var c_number = a_number.concat(b_number);
/// (contents of c_number...)
///length: 8
1
2
3
4
5
NaN
-5
0
/// var a_string: Vector.<String> = new <String>["a","c","d","f"];
/// var b_string: Vector.<String> = new <String>["986","B4","Q","rrr"];
/// var c_string = a_string.concat(b_string);
/// (contents of c_string...)
///length: 8
a
c
d
f
986
B4
Q
rrr
/// var a_uint: Vector.<uint> = new <uint>[1,2];
/// var b_uint: Vector.<uint> = new <uint>[5,16];
/// var c_uint = a_uint.concat(b_uint);
/// (contents of c_uint...)
///length: 4
1
2
5
16
/// var a_vector:Vector.<Vector.<int>> = new <Vector.<int>>[new <int>[1,2]];
/// var b_vector:Vector.<Vector.<int>> = new <Vector.<int>>[new <int>[5,16]];
/// var c_vector = a_vector.concat(b_vector)
/// (contents of c_vector...)
///length: 2
1,2
5,16

Binary file not shown.

View File

@ -1,32 +0,0 @@
package {
public class Test {
}
}
function Superclass() {
}
function Subclass() {
}
Subclass.prototype = new Superclass();
trace("/// var a: Vector.<Object> = new <Object>[];");
var a:Vector.<Object> = new <Object>[];
trace("/// a.length = 2;");
a.length = 2;
trace(a[0]);
trace(a[1]);
trace("/// a[0] = new Superclass();");
a[0] = new Superclass();
trace("/// a[1] = new Subclass();");
a[1] = new Subclass();
trace(a[0]);
trace(a[1]);

View File

@ -1,8 +0,0 @@
/// var a: Vector.<Object> = new <Object>[];
/// a.length = 2;
null
null
/// a[0] = new Superclass();
/// a[1] = new Subclass();
[object Object]
[object Object]

View File

@ -1,30 +0,0 @@
package {
public class Test {
}
}
class Superclass {
}
class Subclass extends Superclass {
}
trace("/// var a: Vector.<Superclass> = new <Superclass>[];");
var a:Vector.<Superclass> = new <Superclass>[];
trace("/// a.length = 2;");
a.length = 2;
trace(a[0]);
trace(a[1]);
trace("/// a[0] = new Superclass();");
a[0] = new Superclass();
trace("/// a[1] = new Subclass();");
a[1] = new Subclass();
trace(a[0]);
trace(a[1]);

View File

@ -1,8 +0,0 @@
/// var a: Vector.<Superclass> = new <Superclass>[];
/// a.length = 2;
null
null
/// a[0] = new Superclass();
/// a[1] = new Subclass();
[object Superclass]
[object Subclass]

View File

@ -1,45 +0,0 @@
package {
public class Test {
}
}
class Superclass {
}
class Subclass extends Superclass {
}
function trace_vec(v) {
for (var i = 0; i < v.length; i += 1) {
trace(v[i]);
}
}
trace("/// var a: Vector.<Superclass> = new <Superclass>[];");
var a:Vector.<Superclass> = new <Superclass>[];
trace("/// a.length = 2;");
a.length = 2;
trace("/// a[0] = new Superclass();");
a[0] = new Superclass();
trace("/// a[1] = new Subclass();");
a[1] = new Subclass();
trace("/// var b: Vector.<Subclass> = new <Subclass>[];");
var b:Vector.<Subclass> = new <Subclass>[];
trace("/// b.length = 1;");
b.length = 1;
trace("/// b[0] = new Subclass();");
b[0] = new Subclass();
trace("/// var c = a.concat(b);");
var c = a.concat(b);
trace("/// (contents of c...)");
trace_vec(c);

View File

@ -1,12 +0,0 @@
/// var a: Vector.<Superclass> = new <Superclass>[];
/// a.length = 2;
/// a[0] = new Superclass();
/// a[1] = new Subclass();
/// var b: Vector.<Subclass> = new <Subclass>[];
/// b.length = 1;
/// b[0] = new Subclass();
/// var c = a.concat(b);
/// (contents of c...)
[object Superclass]
[object Subclass]
[object Subclass]

View File

@ -1,51 +0,0 @@
package {
public class Test {
}
}
class Superclass {
}
class Subclass extends Superclass {
}
function trace_vec(v) {
for (var i = 0; i < v.length; i += 1) {
trace(v[i]);
}
}
trace("/// var a: Vector.<Superclass> = new <Superclass>[];");
var a:Vector.<Superclass> = new <Superclass>[];
trace("/// a.length = 2;");
a.length = 2;
trace("/// a[0] = new Superclass();");
a[0] = new Superclass();
trace("/// a[1] = new Subclass();");
a[1] = new Subclass();
trace("/// var b: Vector.<Subclass> = new <Subclass>[];");
var b:Vector.<Subclass> = new <Subclass>[];
trace("/// b.length = 1;");
b.length = 1;
trace("/// b[0] = new Subclass();");
b[0] = new Subclass();
trace("/// a.every(function (v) { return v is Subclass; }));");
trace(a.every(function (v) { return v is Subclass; }));
trace("/// a.every(function (v) { return v is Superclass; }));");
trace(a.every(function (v) { return v is Superclass; }));
trace("/// b.every(function (v) { return v is Subclass; }));");
trace(b.every(function (v) { return v is Subclass; }));
trace("/// b.every(function (v) { return v is Superclass; }));");
trace(b.every(function (v) { return v is Superclass; }));

View File

@ -1,15 +0,0 @@
/// var a: Vector.<Superclass> = new <Superclass>[];
/// a.length = 2;
/// a[0] = new Superclass();
/// a[1] = new Subclass();
/// var b: Vector.<Subclass> = new <Subclass>[];
/// b.length = 1;
/// b[0] = new Subclass();
/// a.every(function (v) { return v is Subclass; }));
false
/// a.every(function (v) { return v is Superclass; }));
true
/// b.every(function (v) { return v is Subclass; }));
true
/// b.every(function (v) { return v is Superclass; }));
true

View File

@ -1,51 +0,0 @@
package {
public class Test {
}
}
class Superclass {
}
class Subclass extends Superclass {
}
function trace_vec(v) {
for (var i = 0; i < v.length; i += 1) {
trace(v[i]);
}
}
trace("/// var a: Vector.<Superclass> = new <Superclass>[];");
var a:Vector.<Superclass> = new <Superclass>[];
trace("/// a.length = 2;");
a.length = 2;
trace("/// a[0] = new Superclass();");
a[0] = new Superclass();
trace("/// a[1] = new Subclass();");
a[1] = new Subclass();
trace("/// var b: Vector.<Subclass> = new <Subclass>[];");
var b:Vector.<Subclass> = new <Subclass>[];
trace("/// b.length = 1;");
b.length = 1;
trace("/// b[0] = new Subclass();");
b[0] = new Subclass();
trace("/// a.filter(function (v) { return v is Subclass; }));");
trace(a.filter(function (v) { return v is Subclass; }));
trace("/// a.filter(function (v) { return v is Superclass; }));");
trace(a.filter(function (v) { return v is Superclass; }));
trace("/// b.filter(function (v) { return v is Subclass; }));");
trace(b.filter(function (v) { return v is Subclass; }));
trace("/// b.filter(function (v) { return v is Superclass; }));");
trace(b.filter(function (v) { return v is Superclass; }));

View File

@ -1,15 +0,0 @@
/// var a: Vector.<Superclass> = new <Superclass>[];
/// a.length = 2;
/// a[0] = new Superclass();
/// a[1] = new Subclass();
/// var b: Vector.<Subclass> = new <Subclass>[];
/// b.length = 1;
/// b[0] = new Subclass();
/// a.filter(function (v) { return v is Subclass; }));
[object Subclass]
/// a.filter(function (v) { return v is Superclass; }));
[object Superclass],[object Subclass]
/// b.filter(function (v) { return v is Subclass; }));
[object Subclass]
/// b.filter(function (v) { return v is Superclass; }));
[object Subclass]

View File

@ -1,66 +0,0 @@
package {
public class Test {
}
}
class Superclass {
}
class Subclass extends Superclass {
}
function trace_vec(v) {
for (var i = 0; i < v.length; i += 1) {
trace(v[i]);
}
}
trace("/// var a: Vector.<Superclass> = new <Superclass>[];");
var a:Vector.<Superclass> = new <Superclass>[];
trace("/// a.length = 2;");
a.length = 2;
trace("/// var a0 = new Superclass();");
var a0 = new Superclass();
trace("/// a[0] = a0;");
a[0] = a0;
trace("/// var a1 = new Subclass();");
var a1 = new Subclass();
trace("/// a[1] = a1;");
a[1] = a1;
trace("/// var b: Vector.<Subclass> = new <Subclass>[];");
var b:Vector.<Subclass> = new <Subclass>[];
trace("/// b.length = 1;");
b.length = 1;
trace("/// var b0 = new Subclass();");
var b0 = new Subclass();
trace("/// b[0] = b0;");
b[0] = b0;
trace("/// a.indexOf(a0);");
trace(a.indexOf(a0));
trace("/// a.indexOf(a1);");
trace(a.indexOf(a1));
trace("/// a.indexOf(b0);");
trace(a.indexOf(b0));
trace("/// b.indexOf(a0);");
trace(b.indexOf(a0));
trace("/// b.indexOf(a1);");
trace(b.indexOf(a1));
trace("/// b.indexOf(b0);");
trace(b.indexOf(b0));

View File

@ -1,22 +0,0 @@
/// var a: Vector.<Superclass> = new <Superclass>[];
/// a.length = 2;
/// var a0 = new Superclass();
/// a[0] = a0;
/// var a1 = new Subclass();
/// a[1] = a1;
/// var b: Vector.<Subclass> = new <Subclass>[];
/// b.length = 1;
/// var b0 = new Subclass();
/// b[0] = b0;
/// a.indexOf(a0);
0
/// a.indexOf(a1);
1
/// a.indexOf(b0);
-1
/// b.indexOf(a0);
-1
/// b.indexOf(a1);
-1
/// b.indexOf(b0);
0

View File

@ -1,45 +0,0 @@
package {
public class Test {
}
}
class Superclass {
}
class Subclass extends Superclass {
}
function trace_vec(v) {
for (var i = 0; i < v.length; i += 1) {
trace(v[i]);
}
}
trace("/// var a: Vector.<Superclass> = new <Superclass>[];");
var a:Vector.<Superclass> = new <Superclass>[];
trace("/// a.length = 2;");
a.length = 2;
trace("/// a[0] = new Superclass();");
a[0] = new Superclass();
trace("/// a[1] = new Subclass();");
a[1] = new Subclass();
trace("/// var b: Vector.<Subclass> = new <Subclass>[];");
var b:Vector.<Subclass> = new <Subclass>[];
trace("/// b.length = 1;");
b.length = 1;
trace("/// b[0] = new Subclass();");
b[0] = new Subclass();
trace("/// a.join('...');");
trace(a.join("..."));
trace("/// b.join('...');");
trace(b.join("..."));

View File

@ -1,11 +0,0 @@
/// var a: Vector.<Superclass> = new <Superclass>[];
/// a.length = 2;
/// a[0] = new Superclass();
/// a[1] = new Subclass();
/// var b: Vector.<Subclass> = new <Subclass>[];
/// b.length = 1;
/// b[0] = new Subclass();
/// a.join('...');
[object Superclass]...[object Subclass]
/// b.join('...');
[object Subclass]

View File

@ -1,102 +0,0 @@
package {
public class Test {
}
}
class Superclass {
}
class Subclass extends Superclass {
}
function trace_vec(v) {
for (var i = 0; i < v.length; i += 1) {
trace(v[i]);
}
}
trace("/// var a: Vector.<Superclass> = new <Superclass>[];");
var a:Vector.<Superclass> = new <Superclass>[];
trace("/// a.length = 2;");
a.length = 2;
trace("/// var a0 = new Superclass();");
var a0 = new Superclass();
trace("/// a[0] = a0;");
a[0] = a0;
trace("/// var a1 = new Subclass();");
var a1 = new Subclass();
trace("/// a[1] = a1;");
a[1] = a1;
trace("/// var b: Vector.<Subclass> = new <Subclass>[];");
var b:Vector.<Subclass> = new <Subclass>[];
trace("/// b.length = 1;");
b.length = 1;
trace("/// var b0 = new Subclass();");
var b0 = new Subclass();
trace("/// b[0] = b0;");
b[0] = b0;
trace("/// a.lastIndexOf(a0);");
trace(a.lastIndexOf(a0));
trace("/// a.lastIndexOf(a1);");
trace(a.lastIndexOf(a1));
trace("/// a.lastIndexOf(b0);");
trace(a.lastIndexOf(b0));
trace("/// b.lastIndexOf(a0);");
trace(b.lastIndexOf(a0));
trace("/// b.lastIndexOf(a1);");
trace(b.lastIndexOf(a1));
trace("/// b.lastIndexOf(b0);");
trace(b.lastIndexOf(b0));
trace("/// a.lastIndexOf(a0, 0);");
trace(a.lastIndexOf(a0, 0));
trace("/// a.lastIndexOf(a1, 0);");
trace(a.lastIndexOf(a1, 0));
trace("/// a.lastIndexOf(b0, 0);");
trace(a.lastIndexOf(b0, 0));
trace("/// b.lastIndexOf(a0, 0);");
trace(b.lastIndexOf(a0, 0));
trace("/// b.lastIndexOf(a1, 0);");
trace(b.lastIndexOf(a1, 0));
trace("/// b.lastIndexOf(b0, 0);");
trace(b.lastIndexOf(b0, 0));
trace("/// a.lastIndexOf(a0, -1);");
trace(a.lastIndexOf(a0, -1));
trace("/// a.lastIndexOf(a1, -1);");
trace(a.lastIndexOf(a1, -1));
trace("/// a.lastIndexOf(b0, -1);");
trace(a.lastIndexOf(b0, -1));
trace("/// b.lastIndexOf(a0, -1);");
trace(b.lastIndexOf(a0, -1));
trace("/// b.lastIndexOf(a1, -1);");
trace(b.lastIndexOf(a1, -1));
trace("/// b.lastIndexOf(b0, -1);");
trace(b.lastIndexOf(b0, -1));

View File

@ -1,46 +0,0 @@
/// var a: Vector.<Superclass> = new <Superclass>[];
/// a.length = 2;
/// var a0 = new Superclass();
/// a[0] = a0;
/// var a1 = new Subclass();
/// a[1] = a1;
/// var b: Vector.<Subclass> = new <Subclass>[];
/// b.length = 1;
/// var b0 = new Subclass();
/// b[0] = b0;
/// a.lastIndexOf(a0);
0
/// a.lastIndexOf(a1);
1
/// a.lastIndexOf(b0);
-1
/// b.lastIndexOf(a0);
-1
/// b.lastIndexOf(a1);
-1
/// b.lastIndexOf(b0);
0
/// a.lastIndexOf(a0, 0);
0
/// a.lastIndexOf(a1, 0);
-1
/// a.lastIndexOf(b0, 0);
-1
/// b.lastIndexOf(a0, 0);
-1
/// b.lastIndexOf(a1, 0);
-1
/// b.lastIndexOf(b0, 0);
0
/// a.lastIndexOf(a0, -1);
0
/// a.lastIndexOf(a1, -1);
1
/// a.lastIndexOf(b0, -1);
-1
/// b.lastIndexOf(a0, -1);
-1
/// b.lastIndexOf(a1, -1);
-1
/// b.lastIndexOf(b0, -1);
0

View File

@ -1,51 +0,0 @@
package {
public class Test {
}
}
class Superclass {
}
class Subclass extends Superclass {
}
function trace_vec(v) {
for (var i = 0; i < v.length; i += 1) {
trace(v[i]);
}
}
trace("/// var a: Vector.<Superclass> = new <Superclass>[];");
var a:Vector.<Superclass> = new <Superclass>[];
trace("/// a.length = 2;");
a.length = 2;
trace("/// a[0] = new Superclass();");
a[0] = new Superclass();
trace("/// a[1] = new Subclass();");
a[1] = new Subclass();
trace("/// var b: Vector.<Subclass> = new <Subclass>[];");
var b:Vector.<Subclass> = new <Subclass>[];
trace("/// b.length = 1;");
b.length = 1;
trace("/// b[0] = new Subclass();");
b[0] = new Subclass();
trace("/// a.map(function (v) { return new Superclass(); }));");
trace(a.map(function (v) { return new Superclass(); }));
trace("/// a.map(function (v) { return new Superclass(); }));");
trace(a.map(function (v) { return new Superclass(); }));
trace("/// b.map(function (v) { return new Subclass(); }));");
trace(b.map(function (v) { return new Subclass(); }));
trace("/// b.map(function (v) { return new Subclass(); }));");
trace(b.map(function (v) { return new Subclass(); }));

View File

@ -1,15 +0,0 @@
/// var a: Vector.<Superclass> = new <Superclass>[];
/// a.length = 2;
/// a[0] = new Superclass();
/// a[1] = new Subclass();
/// var b: Vector.<Subclass> = new <Subclass>[];
/// b.length = 1;
/// b[0] = new Subclass();
/// a.map(function (v) { return new Superclass(); }));
[object Superclass],[object Superclass]
/// a.map(function (v) { return new Superclass(); }));
[object Superclass],[object Superclass]
/// b.map(function (v) { return new Subclass(); }));
[object Subclass]
/// b.map(function (v) { return new Subclass(); }));
[object Subclass]

View File

@ -1,64 +0,0 @@
package {
public class Test {
}
}
class Superclass {
}
class Subclass extends Superclass {
}
function trace_vector(v: Vector.<*>) {
trace(v.length, "elements");
for (var i = 0; i < v.length; i += 1) {
trace(v[i]);
}
}
trace("/// var a0 = new Superclass();");
var a0 = new Superclass();
trace("/// var a1 = new Subclass();");
var a1 = new Subclass();
trace("/// var a: Vector.<Superclass> = new <Superclass>[a0, a1];");
var a:Vector.<Superclass> = new <Superclass>[a0, a1];
trace("/// var b: Vector.<Subclass> = new <Subclass>[];");
var b:Vector.<Subclass> = new <Subclass>[];
trace("/// b.length = 1;");
b.length = 1;
trace("/// b[0] = new Subclass();");
b[0] = new Subclass();
trace("/// a.pop();");
trace(a.pop());
trace("/// a.pop();");
trace(a.pop());
trace("/// a.pop();");
trace(a.pop());
trace("/// a.push(a1, a0, a0, a1);");
trace(a.push(a1, a0, a0, a1));
trace("/// a[0] === a[3];");
trace(a[0] === a[3]);
trace("/// a[1] === a[2];");
trace(a[1] === a[2]);
trace("/// (contents of a...)");
trace_vector(a);
trace("/// b.push(new Subclass());");
trace(b.push(new Subclass()));
trace("/// (contents of b...)");
trace_vector(b);

View File

@ -1,30 +0,0 @@
/// var a0 = new Superclass();
/// var a1 = new Subclass();
/// var a: Vector.<Superclass> = new <Superclass>[a0, a1];
/// var b: Vector.<Subclass> = new <Subclass>[];
/// b.length = 1;
/// b[0] = new Subclass();
/// a.pop();
[object Subclass]
/// a.pop();
[object Superclass]
/// a.pop();
undefined
/// a.push(a1, a0, a0, a1);
4
/// a[0] === a[3];
true
/// a[1] === a[2];
true
/// (contents of a...)
4 elements
[object Subclass]
[object Superclass]
[object Superclass]
[object Subclass]
/// b.push(new Subclass());
2
/// (contents of b...)
2 elements
[object Subclass]
[object Subclass]

View File

@ -1,42 +0,0 @@
package {
public class Test {
}
}
interface ISubclass {
}
class Subclass implements ISubclass {
}
function trace_vec(v) {
for (var i = 0; i < v.length; i += 1) {
trace(v[i]);
}
}
trace("/// var a: Vector.<ISubclass> = new <ISubclass>[];");
var a:Vector.<ISubclass> = new <ISubclass>[];
trace("/// a.length = 1;");
a.length = 1;
trace("/// a[0] = new Subclass();");
a[0] = new Subclass();
trace("/// var b: Vector.<Subclass> = new <Subclass>[];");
var b:Vector.<Subclass> = new <Subclass>[];
trace("/// b.length = 1;");
b.length = 1;
trace("/// b[0] = new Subclass();");
b[0] = new Subclass();
trace("/// var c = a.concat(b);");
var c = a.concat(b);
trace("/// (contents of c...)");
trace_vec(c);

View File

@ -1,10 +0,0 @@
/// var a: Vector.<ISubclass> = new <ISubclass>[];
/// a.length = 1;
/// a[0] = new Subclass();
/// var b: Vector.<Subclass> = new <Subclass>[];
/// b.length = 1;
/// b[0] = new Subclass();
/// var c = a.concat(b);
/// (contents of c...)
[object Subclass]
[object Subclass]

View File

@ -1,51 +0,0 @@
package {
public class Test {
}
}
interface ISubclass {
}
class Subclass implements ISubclass {
}
function trace_vec(v) {
for (var i = 0; i < v.length; i += 1) {
trace(v[i]);
}
}
trace("/// var a: Vector.<ISubclass> = new <ISubclass>[];");
var a:Vector.<ISubclass> = new <ISubclass>[];
trace("/// a.length = 1;");
a.length = 1;
trace("/// a[0] = new Subclass();");
a[0] = new Subclass();
trace("/// var b: Vector.<Subclass> = new <Subclass>[];");
var b:Vector.<Subclass> = new <Subclass>[];
trace("/// b.length = 2;");
b.length = 2;
trace("/// b[0] = new Subclass();");
b[0] = new Subclass();
trace("/// b[1] = new Subclass();");
b[1] = new Subclass();
trace("/// a.every(function (v) { return v is Subclass; }));");
trace(a.every(function (v) { return v is Subclass; }));
trace("/// a.every(function (v) { return v is ISubclass; }));");
trace(a.every(function (v) { return v is ISubclass; }));
trace("/// b.every(function (v) { return v is Subclass; }));");
trace(b.every(function (v) { return v is Subclass; }));
trace("/// b.every(function (v) { return v is ISubclass; }));");
trace(b.every(function (v) { return v is ISubclass; }));

View File

@ -1,15 +0,0 @@
/// var a: Vector.<ISubclass> = new <ISubclass>[];
/// a.length = 1;
/// a[0] = new Subclass();
/// var b: Vector.<Subclass> = new <Subclass>[];
/// b.length = 2;
/// b[0] = new Subclass();
/// b[1] = new Subclass();
/// a.every(function (v) { return v is Subclass; }));
true
/// a.every(function (v) { return v is ISubclass; }));
true
/// b.every(function (v) { return v is Subclass; }));
true
/// b.every(function (v) { return v is ISubclass; }));
true

View File

@ -1,51 +0,0 @@
package {
public class Test {
}
}
interface ISubclass {
}
class Subclass implements ISubclass {
}
function trace_vec(v) {
for (var i = 0; i < v.length; i += 1) {
trace(v[i]);
}
}
trace("/// var a: Vector.<ISubclass> = new <ISubclass>[];");
var a:Vector.<ISubclass> = new <ISubclass>[];
trace("/// a.length = 1;");
a.length = 1;
trace("/// a[0] = new Subclass();");
a[0] = new Subclass();
trace("/// var b: Vector.<Subclass> = new <Subclass>[];");
var b:Vector.<Subclass> = new <Subclass>[];
trace("/// b.length = 2;");
b.length = 2;
trace("/// b[0] = new Subclass();");
b[0] = new Subclass();
trace("/// b[1] = new Subclass();");
b[1] = new Subclass();
trace("/// a.filter(function (v) { return v is Subclass; }));");
trace(a.filter(function (v) { return v is Subclass; }));
trace("/// a.filter(function (v) { return v is ISubclass; }));");
trace(a.filter(function (v) { return v is ISubclass; }));
trace("/// b.filter(function (v) { return v is Subclass; }));");
trace(b.filter(function (v) { return v is Subclass; }));
trace("/// b.filter(function (v) { return v is ISubclass; }));");
trace(b.filter(function (v) { return v is ISubclass; }));

View File

@ -1,15 +0,0 @@
/// var a: Vector.<ISubclass> = new <ISubclass>[];
/// a.length = 1;
/// a[0] = new Subclass();
/// var b: Vector.<Subclass> = new <Subclass>[];
/// b.length = 2;
/// b[0] = new Subclass();
/// b[1] = new Subclass();
/// a.filter(function (v) { return v is Subclass; }));
[object Subclass]
/// a.filter(function (v) { return v is ISubclass; }));
[object Subclass]
/// b.filter(function (v) { return v is Subclass; }));
[object Subclass],[object Subclass]
/// b.filter(function (v) { return v is ISubclass; }));
[object Subclass],[object Subclass]

View File

@ -1,45 +0,0 @@
package {
public class Test {
}
}
interface ISubclass {
}
class Subclass implements ISubclass {
}
function trace_vec(v) {
for (var i = 0; i < v.length; i += 1) {
trace(v[i]);
}
}
trace("/// var a: Vector.<ISubclass> = new <ISubclass>[];");
var a:Vector.<ISubclass> = new <ISubclass>[];
trace("/// a.length = 1;");
a.length = 1;
trace("/// a[0] = new Subclass();");
a[0] = new Subclass();
trace("/// var b: Vector.<Subclass> = new <Subclass>[];");
var b:Vector.<Subclass> = new <Subclass>[];
trace("/// b.length = 2;");
b.length = 2;
trace("/// b[0] = new Subclass();");
b[0] = new Subclass();
trace("/// b[1] = new Subclass();");
b[1] = new Subclass();
trace("/// a.join('...');");
trace(a.join("..."));
trace("/// b.join('...');");
trace(b.join("..."));

View File

@ -1,11 +0,0 @@
/// var a: Vector.<ISubclass> = new <ISubclass>[];
/// a.length = 1;
/// a[0] = new Subclass();
/// var b: Vector.<Subclass> = new <Subclass>[];
/// b.length = 2;
/// b[0] = new Subclass();
/// b[1] = new Subclass();
/// a.join('...');
[object Subclass]
/// b.join('...');
[object Subclass]...[object Subclass]

View File

@ -0,0 +1,197 @@
package {
public class Test {
}
}
trace("/// var a_bool: Vector.<Boolean> = new <Boolean>[true, false];");
var a_bool:Vector.<Boolean> = new <Boolean>[true, false];
trace("/// var b_bool: Vector.<Boolean> = new <Boolean>[true, true];");
var b_bool:Vector.<Boolean> = new <Boolean>[true, true];
trace("/// a_bool.every(function(v) { return v; });");
trace(a_bool.every(function (v) { return v; }));
trace("/// a_bool.every(function(v) { return true; });");
trace(a_bool.every(function (v) { return true; }));
trace("/// b_bool.every(function(v) { return v; });");
trace(b_bool.every(function (v) { return v; }));
trace("/// b_bool.every(function(v) { return true; });");
trace(b_bool.every(function (v) { return true; }));
class Superclass {
}
class Subclass extends Superclass {
}
trace("/// var a_class: Vector.<Superclass> = new <Superclass>[];");
var a_class:Vector.<Superclass> = new <Superclass>[];
trace("/// a_class.length = 2;");
a_class.length = 2;
trace("/// a_class[0] = new Superclass();");
a_class[0] = new Superclass();
trace("/// a_class[1] = new Subclass();");
a_class[1] = new Subclass();
trace("/// var b_class: Vector.<Subclass> = new <Subclass>[];");
var b_class:Vector.<Subclass> = new <Subclass>[];
trace("/// b_class.length = 1;");
b_class.length = 1;
trace("/// b_class[0] = new Subclass();");
b_class[0] = new Subclass();
trace("/// a_class.every(function (v) { return v is Subclass; }));");
trace(a_class.every(function (v) { return v is Subclass; }));
trace("/// a_class.every(function (v) { return v is Superclass; }));");
trace(a_class.every(function (v) { return v is Superclass; }));
trace("/// b_class.every(function (v) { return v is Subclass; }));");
trace(b_class.every(function (v) { return v is Subclass; }));
trace("/// b_class.every(function (v) { return v is Superclass; }));");
trace(b_class.every(function (v) { return v is Superclass; }));
interface Interface {
}
class Implementer implements Interface {
}
trace("/// var a_iface: Vector.<Interface> = new <Interface>[];");
var a_iface:Vector.<Interface> = new <Interface>[];
trace("/// a_iface.length = 1;");
a_iface.length = 1;
trace("/// a_iface[0] = new Implementer();");
a_iface[0] = new Implementer();
trace("/// var b_iface: Vector.<Implementer> = new <Implementer>[];");
var b_iface:Vector.<Implementer> = new <Implementer>[];
trace("/// b_iface.length = 2;");
b_iface.length = 2;
trace("/// b_iface[0] = new Implementer();");
b_iface[0] = new Implementer();
trace("/// b_iface[1] = new Implementer();");
b_iface[1] = new Implementer();
trace("/// a_iface.every(function (v) { return v is Implementer; }));");
trace(a_iface.every(function (v) { return v is Implementer; }));
trace("/// a_iface.every(function (v) { return v is Interface; }));");
trace(a_iface.every(function (v) { return v is Interface; }));
trace("/// b_iface.every(function (v) { return v is Implementer; }));");
trace(b_iface.every(function (v) { return v is Implementer; }));
trace("/// b_iface.every(function (v) { return v is Interface; }));");
trace(b_iface.every(function (v) { return v is Interface; }));
trace("/// var a_int: Vector.<int> = new <int>[1,2];");
var a_int:Vector.<int> = new <int>[1,2];
trace("/// var b_int: Vector.<int> = new <int>[5,16];");
var b_int:Vector.<int> = new <int>[5,16];
trace("/// a_int.every(function (v) { return v > 0; }));");
trace(a_int.every(function (v) { return v > 0; }));
trace("/// a_int.every(function (v) { return v > 2; }));");
trace(a_int.every(function (v) { return v > 2; }));
trace("/// b_int.every(function (v) { return v > 4; }));");
trace(b_int.every(function (v) { return v > 4; }));
trace("/// b_int.every(function (v) { return v > 10; }));");
trace(b_int.every(function (v) { return v > 10; }));
trace("/// var a_number: Vector.<Number> = new <Number>[1,2,3,4];");
var a_number:Vector.<Number> = new <Number>[1,2,3,4];
trace("/// var b_number: Vector.<Number> = new <Number>[5, NaN, -5, 0];");
var b_number:Vector.<Number> = new <Number>[5, NaN, -5, 0];
trace("/// a_number.every(function (v) { return v > 0; }));");
trace(a_number.every(function (v) { return v > 0; }));
trace("/// a_number.every(function (v) { return v > 2; }));");
trace(a_number.every(function (v) { return v > 2; }));
trace("/// b_number.every(function (v) { return v > 4; }));");
trace(b_number.every(function (v) { return v > 4; }));
trace("/// b_number.every(function (v) { return v > 10; }));");
trace(b_number.every(function (v) { return v > 10; }));
trace("/// b_number.every(function (v) { return v > -6 || isNaN(v); }));");
trace(b_number.every(function (v) { return v > -6 || isNaN(v); }));
trace("/// var a_string: Vector.<String> = new <String>[\"a\",\"c\",\"d\",\"f\"];");
var a_string:Vector.<String> = new <String>["a", "c", "d", "f"];
trace("/// var b_string: Vector.<String> = new <String>[\"986\",\"B4\",\"Q\",\"rrr\"];");
var b_string:Vector.<String> = new <String>["986", "B4", "Q", "rrr"];
trace("/// a_string.every(function (v) { return v.length > 0; }));");
trace(a_string.every(function (v) { return v.length > 0; }));
trace("/// a_string.every(function (v) { return v.length > 2; }));");
trace(a_string.every(function (v) { return v.length > 2; }));
trace("/// b_string.every(function (v) { return v.length > 0; }));");
trace(b_string.every(function (v) { return v.length > 0; }));
trace("/// b_string.every(function (v) { return v.length > 4; }));");
trace(b_string.every(function (v) { return v.length > 4; }));
trace("/// var a_uint: Vector.<uint> = new <uint>[1,2];");
var a_uint:Vector.<uint> = new <uint>[1,2];
trace("/// var b_uint: Vector.<uint> = new <uint>[5,16];");
var b_uint:Vector.<uint> = new <uint>[5,16];
trace("/// a_uint.every(function (v) { return v > 0; }));");
trace(a_uint.every(function (v) { return v > 0; }));
trace("/// a_uint.every(function (v) { return v > 2; }));");
trace(a_uint.every(function (v) { return v > 2; }));
trace("/// b_uint.every(function (v) { return v > 4; }));");
trace(b_uint.every(function (v) { return v > 4; }));
trace("/// b_uint.every(function (v) { return v > 10; }));");
trace(b_uint.every(function (v) { return v > 10; }));
trace("/// var a_vector:Vector.<Vector.<int>> = new <Vector.<int>>[new <int>[1,2], new <int>[4,3]];");
var a_vector:Vector.<Vector.<int>> = new <Vector.<int>>[new <int>[1,2], new <int>[4,3]];
trace("/// var b_vector:Vector.<Vector.<int>> = new <Vector.<int>>[new <int>[5,16], new <int>[19,8]];");
var b_vector:Vector.<Vector.<int>> = new <Vector.<int>>[new <int>[5,16], new <int>[19,8]];
trace("/// a_vector.every(function (v) { return v.every(function (v) { return v > 0; }); });");
trace(a_vector.every(function (v) { return v.every(function (v) { return v > 0; }); }));
trace("/// a_vector.every(function (v) { return v.every(function (v) { return v > 2; }); });");
trace(a_vector.every(function (v) { return v.every(function (v) { return v > 2; }); }));
trace("/// b_vector.every(function (v) { return v.every(function (v) { return v > 4; }); });");
trace(b_vector.every(function (v) { return v.every(function (v) { return v > 4; }); }));
trace("/// b_vector.every(function (v) { return v.every(function (v) { return v > 10; }); });");
trace(b_vector.every(function (v) { return v.every(function (v) { return v > 10; }); }));

View File

@ -0,0 +1,92 @@
/// var a_bool: Vector.<Boolean> = new <Boolean>[true, false];
/// var b_bool: Vector.<Boolean> = new <Boolean>[true, true];
/// a_bool.every(function(v) { return v; });
false
/// a_bool.every(function(v) { return true; });
true
/// b_bool.every(function(v) { return v; });
true
/// b_bool.every(function(v) { return true; });
true
/// var a_class: Vector.<Superclass> = new <Superclass>[];
/// a_class.length = 2;
/// a_class[0] = new Superclass();
/// a_class[1] = new Subclass();
/// var b_class: Vector.<Subclass> = new <Subclass>[];
/// b_class.length = 1;
/// b_class[0] = new Subclass();
/// a_class.every(function (v) { return v is Subclass; }));
false
/// a_class.every(function (v) { return v is Superclass; }));
true
/// b_class.every(function (v) { return v is Subclass; }));
true
/// b_class.every(function (v) { return v is Superclass; }));
true
/// var a_iface: Vector.<Interface> = new <Interface>[];
/// a_iface.length = 1;
/// a_iface[0] = new Implementer();
/// var b_iface: Vector.<Implementer> = new <Implementer>[];
/// b_iface.length = 2;
/// b_iface[0] = new Implementer();
/// b_iface[1] = new Implementer();
/// a_iface.every(function (v) { return v is Implementer; }));
true
/// a_iface.every(function (v) { return v is Interface; }));
true
/// b_iface.every(function (v) { return v is Implementer; }));
true
/// b_iface.every(function (v) { return v is Interface; }));
true
/// var a_int: Vector.<int> = new <int>[1,2];
/// var b_int: Vector.<int> = new <int>[5,16];
/// a_int.every(function (v) { return v > 0; }));
true
/// a_int.every(function (v) { return v > 2; }));
false
/// b_int.every(function (v) { return v > 4; }));
true
/// b_int.every(function (v) { return v > 10; }));
false
/// var a_number: Vector.<Number> = new <Number>[1,2,3,4];
/// var b_number: Vector.<Number> = new <Number>[5, NaN, -5, 0];
/// a_number.every(function (v) { return v > 0; }));
true
/// a_number.every(function (v) { return v > 2; }));
false
/// b_number.every(function (v) { return v > 4; }));
false
/// b_number.every(function (v) { return v > 10; }));
false
/// b_number.every(function (v) { return v > -6 || isNaN(v); }));
true
/// var a_string: Vector.<String> = new <String>["a","c","d","f"];
/// var b_string: Vector.<String> = new <String>["986","B4","Q","rrr"];
/// a_string.every(function (v) { return v.length > 0; }));
true
/// a_string.every(function (v) { return v.length > 2; }));
false
/// b_string.every(function (v) { return v.length > 0; }));
true
/// b_string.every(function (v) { return v.length > 4; }));
false
/// var a_uint: Vector.<uint> = new <uint>[1,2];
/// var b_uint: Vector.<uint> = new <uint>[5,16];
/// a_uint.every(function (v) { return v > 0; }));
true
/// a_uint.every(function (v) { return v > 2; }));
false
/// b_uint.every(function (v) { return v > 4; }));
true
/// b_uint.every(function (v) { return v > 10; }));
false
/// var a_vector:Vector.<Vector.<int>> = new <Vector.<int>>[new <int>[1,2], new <int>[4,3]];
/// var b_vector:Vector.<Vector.<int>> = new <Vector.<int>>[new <int>[5,16], new <int>[19,8]];
/// a_vector.every(function (v) { return v.every(function (v) { return v > 0; }); });
true
/// a_vector.every(function (v) { return v.every(function (v) { return v > 2; }); });
false
/// b_vector.every(function (v) { return v.every(function (v) { return v > 4; }); });
true
/// b_vector.every(function (v) { return v.every(function (v) { return v > 10; }); });
false

Binary file not shown.

View File

@ -0,0 +1,204 @@
package {
public class Test {
}
}
function trace_vector(v: Vector.<*>) {
trace(v.length, "elements");
for (var i = 0; i < v.length; i += 1) {
trace(v[i]);
}
}
trace("/// var a_bool: Vector.<Boolean> = new <Boolean>[true, false];");
var a_bool:Vector.<Boolean> = new <Boolean>[true, false];
trace("/// var b_bool: Vector.<Boolean> = new <Boolean>[true, true];");
var b_bool:Vector.<Boolean> = new <Boolean>[true, true];
trace("/// a_bool.filter(function(v) { return v; });");
trace_vector(a_bool.filter(function (v) { return v; }));
trace("/// a_bool.filter(function(v) { return !v; });");
trace_vector(a_bool.filter(function (v) { return !v; }));
trace("/// b_bool.filter(function(v) { return v; });");
trace_vector(b_bool.filter(function (v) { return v; }));
trace("/// b_bool.filter(function(v) { return !v; });");
trace_vector(b_bool.filter(function (v) { return !v; }));
class Superclass {
}
class Subclass extends Superclass {
}
trace("/// var a_class: Vector.<Superclass> = new <Superclass>[];");
var a_class:Vector.<Superclass> = new <Superclass>[];
trace("/// a_class.length = 2;");
a_class.length = 2;
trace("/// a_class[0] = new Superclass();");
a_class[0] = new Superclass();
trace("/// a_class[1] = new Subclass();");
a_class[1] = new Subclass();
trace("/// var b_class: Vector.<Subclass> = new <Subclass>[];");
var b_class:Vector.<Subclass> = new <Subclass>[];
trace("/// b_class.length = 1;");
b_class.length = 1;
trace("/// b_class[0] = new Subclass();");
b_class[0] = new Subclass();
trace("/// a_class.filter(function (v) { return v is Subclass; }));");
trace(a_class.filter(function (v) { return v is Subclass; }));
trace("/// a_class.filter(function (v) { return v is Superclass; }));");
trace(a_class.filter(function (v) { return v is Superclass; }));
trace("/// b_class.filter(function (v) { return v is Subclass; }));");
trace(b_class.filter(function (v) { return v is Subclass; }));
trace("/// b_class.filter(function (v) { return v is Superclass; }));");
trace(b_class.filter(function (v) { return v is Superclass; }));
interface Interface {
}
class Implementer implements Interface {
}
trace("/// var a_iface: Vector.<Interface> = new <Interface>[];");
var a_iface:Vector.<Interface> = new <Interface>[];
trace("/// a_iface.length = 1;");
a_iface.length = 1;
trace("/// a_iface[0] = new Implementer();");
a_iface[0] = new Implementer();
trace("/// var b_iface: Vector.<Implementer> = new <Implementer>[];");
var b_iface:Vector.<Implementer> = new <Implementer>[];
trace("/// b_iface.length = 2;");
b_iface.length = 2;
trace("/// b_iface[0] = new Implementer();");
b_iface[0] = new Implementer();
trace("/// b_iface[1] = new Implementer();");
b_iface[1] = new Implementer();
trace("/// a_iface.filter(function (v) { return v is Implementer; }));");
trace(a_iface.filter(function (v) { return v is Implementer; }));
trace("/// a_iface.filter(function (v) { return v is Interface; }));");
trace(a_iface.filter(function (v) { return v is Interface; }));
trace("/// b_iface.filter(function (v) { return v is Implementer; }));");
trace(b_iface.filter(function (v) { return v is Implementer; }));
trace("/// b_iface.filter(function (v) { return v is Interface; }));");
trace(b_iface.filter(function (v) { return v is Interface; }));
trace("/// var a_int: Vector.<int> = new <int>[1,2];");
var a_int:Vector.<int> = new <int>[1,2];
trace("/// var b_int: Vector.<int> = new <int>[5,16];");
var b_int:Vector.<int> = new <int>[5,16];
trace("/// a_int.filter(function (v) { return v > 0; }));");
trace(a_int.filter(function (v) { return v > 0; }));
trace("/// a_int.filter(function (v) { return v > 2; }));");
trace(a_int.filter(function (v) { return v > 2; }));
trace("/// b_int.filter(function (v) { return v > 4; }));");
trace(b_int.filter(function (v) { return v > 4; }));
trace("/// b_int.filter(function (v) { return v > 10; }));");
trace(b_int.filter(function (v) { return v > 10; }));
trace("/// var a_number: Vector.<Number> = new <Number>[1,2,3,4];");
var a_number:Vector.<Number> = new <Number>[1,2,3,4];
trace("/// var b_number: Vector.<Number> = new <Number>[5, NaN, -5, 0];");
var b_number:Vector.<Number> = new <Number>[5, NaN, -5, 0];
trace("/// a_number.filter(function (v) { return v > 0; }));");
trace(a_number.filter(function (v) { return v > 0; }));
trace("/// a_number.filter(function (v) { return v > 2; }));");
trace(a_number.filter(function (v) { return v > 2; }));
trace("/// b_number.filter(function (v) { return v > 4; }));");
trace(b_number.filter(function (v) { return v > 4; }));
trace("/// b_number.filter(function (v) { return v > 10; }));");
trace(b_number.filter(function (v) { return v > 10; }));
trace("/// b_number.filter(function (v) { return v > -6 || isNaN(v); }));");
trace(b_number.filter(function (v) { return v > -6 || isNaN(v); }));
trace("/// var a_string: Vector.<String> = new <String>[\"a\",\"c\",\"d\",\"f\"];");
var a_string:Vector.<String> = new <String>["a", "c", "d", "f"];
trace("/// var b_string: Vector.<String> = new <String>[\"986\",\"B4\",\"Q\",\"rrr\"];");
var b_string:Vector.<String> = new <String>["986", "B4", "Q", "rrr"];
trace("/// a_string.filter(function (v) { return v.length > 0; }));");
trace(a_string.filter(function (v) { return v.length > 0; }));
trace("/// a_string.filter(function (v) { return v.length > 2; }));");
trace(a_string.filter(function (v) { return v.length > 2; }));
trace("/// b_string.filter(function (v) { return v.length > 0; }));");
trace(b_string.filter(function (v) { return v.length > 0; }));
trace("/// b_string.filter(function (v) { return v.length > 4; }));");
trace(b_string.filter(function (v) { return v.length > 4; }));
trace("/// var a_uint: Vector.<uint> = new <uint>[1,2];");
var a_uint:Vector.<uint> = new <uint>[1,2];
trace("/// var b_uint: Vector.<uint> = new <uint>[5,16];");
var b_uint:Vector.<uint> = new <uint>[5,16];
trace("/// a_uint.filter(function (v) { return v > 0; }));");
trace(a_uint.filter(function (v) { return v > 0; }));
trace("/// a_uint.filter(function (v) { return v > 2; }));");
trace(a_uint.filter(function (v) { return v > 2; }));
trace("/// b_uint.filter(function (v) { return v > 4; }));");
trace(b_uint.filter(function (v) { return v > 4; }));
trace("/// b_uint.filter(function (v) { return v > 10; }));");
trace(b_uint.filter(function (v) { return v > 10; }));
trace("/// var a_vector:Vector.<Vector.<int>> = new <Vector.<int>>[new <int>[1,2], new <int>[4,3]];");
var a_vector:Vector.<Vector.<int>> = new <Vector.<int>>[new <int>[1,2], new <int>[4,3]];
trace("/// var b_vector:Vector.<Vector.<int>> = new <Vector.<int>>[new <int>[5,16], new <int>[19,8]];");
var b_vector:Vector.<Vector.<int>> = new <Vector.<int>>[new <int>[5,16], new <int>[19,8]];
trace("/// a_vector.filter(function (v) { return v.filter(function (v) { return v > 0; }).length > 0; });");
trace(a_vector.filter(function (v) { return v.filter(function (v) { return v > 0; }).length > 0; }));
trace("/// a_vector.filter(function (v) { return v.filter(function (v) { return v > 2; }).length > 0; });");
trace(a_vector.filter(function (v) { return v.filter(function (v) { return v > 2; }).length > 0; }));
trace("/// b_vector.filter(function (v) { return v.filter(function (v) { return v > 4; }).length > 0; });");
trace(b_vector.filter(function (v) { return v.filter(function (v) { return v > 4; }).length > 0; }));
trace("/// b_vector.filter(function (v) { return v.filter(function (v) { return v > 25; }).length > 0; });");
trace(b_vector.filter(function (v) { return v.filter(function (v) { return v > 25; }).length > 0; }));

View File

@ -0,0 +1,96 @@
/// var a_bool: Vector.<Boolean> = new <Boolean>[true, false];
/// var b_bool: Vector.<Boolean> = new <Boolean>[true, true];
/// a_bool.filter(function(v) { return v; });
1 elements
true
/// a_bool.filter(function(v) { return !v; });
1 elements
false
/// b_bool.filter(function(v) { return v; });
2 elements
true
true
/// b_bool.filter(function(v) { return !v; });
0 elements
/// var a_class: Vector.<Superclass> = new <Superclass>[];
/// a_class.length = 2;
/// a_class[0] = new Superclass();
/// a_class[1] = new Subclass();
/// var b_class: Vector.<Subclass> = new <Subclass>[];
/// b_class.length = 1;
/// b_class[0] = new Subclass();
/// a_class.filter(function (v) { return v is Subclass; }));
[object Subclass]
/// a_class.filter(function (v) { return v is Superclass; }));
[object Superclass],[object Subclass]
/// b_class.filter(function (v) { return v is Subclass; }));
[object Subclass]
/// b_class.filter(function (v) { return v is Superclass; }));
[object Subclass]
/// var a_iface: Vector.<Interface> = new <Interface>[];
/// a_iface.length = 1;
/// a_iface[0] = new Implementer();
/// var b_iface: Vector.<Implementer> = new <Implementer>[];
/// b_iface.length = 2;
/// b_iface[0] = new Implementer();
/// b_iface[1] = new Implementer();
/// a_iface.filter(function (v) { return v is Implementer; }));
[object Implementer]
/// a_iface.filter(function (v) { return v is Interface; }));
[object Implementer]
/// b_iface.filter(function (v) { return v is Implementer; }));
[object Implementer],[object Implementer]
/// b_iface.filter(function (v) { return v is Interface; }));
[object Implementer],[object Implementer]
/// var a_int: Vector.<int> = new <int>[1,2];
/// var b_int: Vector.<int> = new <int>[5,16];
/// a_int.filter(function (v) { return v > 0; }));
1,2
/// a_int.filter(function (v) { return v > 2; }));
/// b_int.filter(function (v) { return v > 4; }));
5,16
/// b_int.filter(function (v) { return v > 10; }));
16
/// var a_number: Vector.<Number> = new <Number>[1,2,3,4];
/// var b_number: Vector.<Number> = new <Number>[5, NaN, -5, 0];
/// a_number.filter(function (v) { return v > 0; }));
1,2,3,4
/// a_number.filter(function (v) { return v > 2; }));
3,4
/// b_number.filter(function (v) { return v > 4; }));
5
/// b_number.filter(function (v) { return v > 10; }));
/// b_number.filter(function (v) { return v > -6 || isNaN(v); }));
5,NaN,-5,0
/// var a_string: Vector.<String> = new <String>["a","c","d","f"];
/// var b_string: Vector.<String> = new <String>["986","B4","Q","rrr"];
/// a_string.filter(function (v) { return v.length > 0; }));
a,c,d,f
/// a_string.filter(function (v) { return v.length > 2; }));
/// b_string.filter(function (v) { return v.length > 0; }));
986,B4,Q,rrr
/// b_string.filter(function (v) { return v.length > 4; }));
/// var a_uint: Vector.<uint> = new <uint>[1,2];
/// var b_uint: Vector.<uint> = new <uint>[5,16];
/// a_uint.filter(function (v) { return v > 0; }));
1,2
/// a_uint.filter(function (v) { return v > 2; }));
/// b_uint.filter(function (v) { return v > 4; }));
5,16
/// b_uint.filter(function (v) { return v > 10; }));
16
/// var a_vector:Vector.<Vector.<int>> = new <Vector.<int>>[new <int>[1,2], new <int>[4,3]];
/// var b_vector:Vector.<Vector.<int>> = new <Vector.<int>>[new <int>[5,16], new <int>[19,8]];
/// a_vector.filter(function (v) { return v.filter(function (v) { return v > 0; }).length > 0; });
1,2,4,3
/// a_vector.filter(function (v) { return v.filter(function (v) { return v > 2; }).length > 0; });
4,3
/// b_vector.filter(function (v) { return v.filter(function (v) { return v > 4; }).length > 0; });
5,16,19,8
/// b_vector.filter(function (v) { return v.filter(function (v) { return v > 25; }).length > 0; });

Some files were not shown because too many files have changed in this diff Show More