From 901d84b2cf63e75f4ea0b0e8491702f2139b51cd Mon Sep 17 00:00:00 2001 From: Lord-McSweeney Date: Thu, 19 Oct 2023 21:10:56 -0700 Subject: [PATCH] avm2: Fix defining const slots on global object --- core/src/avm2/vtable.rs | 2 +- .../RuntimeErrors/Error1074IllegalWriteToReadOnlyProp/test.toml | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/core/src/avm2/vtable.rs b/core/src/avm2/vtable.rs index f474c667f..ad8bcf177 100644 --- a/core/src/avm2/vtable.rs +++ b/core/src/avm2/vtable.rs @@ -559,7 +559,7 @@ impl<'gc> VTable<'gc> { let new_slot_id = write.default_slots.len() as u32 - 1; write .resolved_traits - .insert(name, Property::new_slot(new_slot_id)); + .insert(name, Property::new_const_slot(new_slot_id)); write .slot_classes .push(PropertyClass::Class(class.inner_class_definition())); diff --git a/tests/tests/swfs/from_avmplus/as3/RuntimeErrors/Error1074IllegalWriteToReadOnlyProp/test.toml b/tests/tests/swfs/from_avmplus/as3/RuntimeErrors/Error1074IllegalWriteToReadOnlyProp/test.toml index 29f3cef79..cf6123969 100644 --- a/tests/tests/swfs/from_avmplus/as3/RuntimeErrors/Error1074IllegalWriteToReadOnlyProp/test.toml +++ b/tests/tests/swfs/from_avmplus/as3/RuntimeErrors/Error1074IllegalWriteToReadOnlyProp/test.toml @@ -1,2 +1 @@ num_ticks = 1 -known_failure = true