tests: Add test for virtual properties on prototype

This commit is contained in:
Mike Welsh 2020-07-02 15:10:01 -07:00
parent fec8cf5e52
commit 804385347f
4 changed files with 18 additions and 0 deletions

View File

@ -217,6 +217,7 @@ swf_tests! {
(error, "avm1/error", 1),
(color_transform, "avm1/color_transform", 1),
(with, "avm1/with", 1),
(prototype_properties, "avm1/prototype_properties", 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,17 @@
// Foo.prototype.hasOwnProperty('prop')
true
// Foo.prototype.hasOwnProperty('readOnlyProp')
true
// foo = new Foo()
// foo.prop = 10
// foo.prop
10
// foo.hasOwnProperty('prop')
false
// foo.readOnlyProp = 10
// foo.readOnlyProp
5
// foo.hasOwnProperty('readOnlyProp')
false

Binary file not shown.

Binary file not shown.