1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-16 06:14:58 +00:00

LibJS: Add Object::define_property_without_transition() helper

This allows us to avoid transitioning in two common cases, saving some
time during object construction.
This commit is contained in:
Andreas Kling 2020-10-06 16:57:02 +02:00
parent 21ac343211
commit 4c33209011
3 changed files with 10 additions and 3 deletions

View file

@ -69,7 +69,7 @@ void ScriptFunction::initialize(GlobalObject& global_object)
Function::initialize(global_object);
if (!m_is_arrow_function) {
Object* prototype = Object::create_empty(global_object);
prototype->define_property("constructor", this, Attribute::Writable | Attribute::Configurable);
prototype->define_property_without_transition("constructor", this, Attribute::Writable | Attribute::Configurable);
define_property("prototype", prototype, 0);
}
define_native_property("length", length_getter, nullptr, Attribute::Configurable);