From 45eef97906611d65cdb47f117b0bf435689e1609 Mon Sep 17 00:00:00 2001 From: Linus Groh Date: Sat, 28 Aug 2021 17:23:10 +0100 Subject: [PATCH] LibJS: Avoid transitions in GlobalObject::initialize_constructor() We don't need transitions for either of these: - Adding the 'name' property to a constructor object - Adding the 'constructor' property to its prototype object --- Userland/Libraries/LibJS/Runtime/GlobalObject.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Userland/Libraries/LibJS/Runtime/GlobalObject.h b/Userland/Libraries/LibJS/Runtime/GlobalObject.h index 4660e28c4b..cdcacbb97a 100644 --- a/Userland/Libraries/LibJS/Runtime/GlobalObject.h +++ b/Userland/Libraries/LibJS/Runtime/GlobalObject.h @@ -136,11 +136,11 @@ inline void GlobalObject::initialize_constructor(PropertyName const& property_na { auto& vm = this->vm(); constructor = heap().allocate(*this, *this); - constructor->define_direct_property(vm.names.name, js_string(heap(), property_name.as_string()), Attribute::Configurable); + constructor->define_direct_property_without_transition(vm.names.name, js_string(heap(), property_name.as_string()), Attribute::Configurable); if (vm.exception()) return; if (prototype) { - prototype->define_direct_property(vm.names.constructor, constructor, Attribute::Writable | Attribute::Configurable); + prototype->define_direct_property_without_transition(vm.names.constructor, constructor, Attribute::Writable | Attribute::Configurable); if (vm.exception()) return; }