Add test for the constructor property on v6 and v7 SWFs

This commit is contained in:
David Wendt 2020-04-18 17:16:51 -04:00
parent b3322acc8c
commit bb879870ec
7 changed files with 72 additions and 0 deletions

View File

@ -187,6 +187,8 @@ swf_tests! {
(as2_super_and_this_v6, "avm1/as2_super_and_this_v6", 1),
(as2_super_and_this_v8, "avm1/as2_super_and_this_v8", 1),
(as2_super_via_manual_prototype, "avm1/as2_super_via_manual_prototype", 1),
(as1_constructor_v6, "avm1/as1_constructor_v6", 1),
(as1_constructor_v7, "avm1/as1_constructor_v7", 1),
}
// TODO: These tests have some inaccuracies currently, so we use approx_eq to test that numeric values are close enough.

View File

@ -0,0 +1,35 @@
//function SuperClass() {}
//sub_prototype = new SuperClass();
//sub_prototype.constructor === SuperClass
true
//sub_prototype.constructor === Object
false
//sub_prototype.hasOwnProperty('constructor')
true
//function SubClass() {}
//SubClass.prototype.constructor === SubClass
true
//SubClass.prototype.constructor === SuperClass
false
//SubClass.prototype.constructor === Object
false
//SubClass.prototype.hasOwnProperty('constructor')
true
//SubClass.prototype = sub_prototype
//SubClass.prototype.constructor === SubClass
false
//SubClass.prototype.constructor === SuperClass
true
//SubClass.prototype.constructor === Object
false
//SubClass.prototype.hasOwnProperty('constructor')
true
//sc_instance = new SubClass();
//sc_instance.constructor === SubClass
true
//sc_instance.constructor === SuperClass
false
//sc_instance.constructor === Object
false
//sc_instance.hasOwnProperty('constructor')
true

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,35 @@
//function SuperClass() {}
//sub_prototype = new SuperClass();
//sub_prototype.constructor === SuperClass
true
//sub_prototype.constructor === Object
false
//sub_prototype.hasOwnProperty('constructor')
false
//function SubClass() {}
//SubClass.prototype.constructor === SubClass
true
//SubClass.prototype.constructor === SuperClass
false
//SubClass.prototype.constructor === Object
false
//SubClass.prototype.hasOwnProperty('constructor')
true
//SubClass.prototype = sub_prototype
//SubClass.prototype.constructor === SubClass
false
//SubClass.prototype.constructor === SuperClass
true
//SubClass.prototype.constructor === Object
false
//SubClass.prototype.hasOwnProperty('constructor')
false
//sc_instance = new SubClass();
//sc_instance.constructor === SubClass
false
//sc_instance.constructor === SuperClass
true
//sc_instance.constructor === Object
false
//sc_instance.hasOwnProperty('constructor')
false

Binary file not shown.

Binary file not shown.