mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-26 22:38:51 +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:
parent
21ac343211
commit
4c33209011
Notes:
sideshowbarker
2024-07-19 02:00:30 +09:00
Author: https://github.com/awesomekling
Commit: 4c33209011
3 changed files with 10 additions and 3 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue