Add `as3_object_enumeration` and `as3_class_enumeration` tests.
The former tests iterating normal objects and the latter tests iterating objects with prototypes.
This commit is contained in:
parent
c014b40109
commit
d29f3dc1d0
|
@ -238,6 +238,8 @@ swf_tests! {
|
|||
(as3_es4_method_binding, "avm2/es4_method_binding", 1),
|
||||
(as3_control_flow_bool, "avm2/control_flow_bool", 1),
|
||||
(as3_control_flow_stricteq, "avm2/control_flow_stricteq", 1),
|
||||
(as3_object_enumeration, "avm2/object_enumeration", 1),
|
||||
(as3_class_enumeration, "avm2/class_enumeration", 1),
|
||||
}
|
||||
|
||||
// TODO: These tests have some inaccuracies currently, so we use approx_eq to test that numeric values are close enough.
|
||||
|
|
|
@ -0,0 +1,17 @@
|
|||
package {
|
||||
public class Test {}
|
||||
}
|
||||
|
||||
dynamic class ES4Class {
|
||||
public var variable = "TEST FAIL: Trait properties are NOT enumerable! (var)";
|
||||
public const constant = "TEST FAIL: Trait properties are NOT enumerable! (const)";
|
||||
}
|
||||
|
||||
var x = new ES4Class();
|
||||
x.dynamic_variable = "variable value";
|
||||
ES4Class.prototype.dynamic_prototype_variable = "prototype value";
|
||||
|
||||
for (var name in x) {
|
||||
trace(name);
|
||||
trace(x[name]);
|
||||
}
|
|
@ -0,0 +1,4 @@
|
|||
dynamic_variable
|
||||
variable value
|
||||
dynamic_prototype_variable
|
||||
prototype value
|
Binary file not shown.
Binary file not shown.
|
@ -0,0 +1,10 @@
|
|||
package {
|
||||
public class Test {}
|
||||
}
|
||||
|
||||
var x = {"key": "value"};
|
||||
|
||||
for (var name in x) {
|
||||
trace(name);
|
||||
trace(x[name]);
|
||||
}
|
|
@ -0,0 +1,2 @@
|
|||
key
|
||||
value
|
Binary file not shown.
Binary file not shown.
Loading…
Reference in New Issue