mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-28 11:49:44 +00:00
LibJS: Initial class implementation; allow super expressions in object
literal methods; add EnvrionmentRecord fields and methods to LexicalEnvironment Adding EnvrionmentRecord's fields and methods lets us throw an exception when |this| is not initialized, which occurs when the super constructor in a derived class has not yet been called, or when |this| has already been initialized (the super constructor was already called).
This commit is contained in:
parent
a535d58cac
commit
7533fd8b02
Notes:
sideshowbarker
2024-07-19 05:19:30 +09:00
Author: https://github.com/jack-karamanian
Commit: 7533fd8b02
Pull-request: https://github.com/SerenityOS/serenity/pull/2533
Reviewed-by: https://github.com/linusg
18 changed files with 967 additions and 92 deletions
|
@ -437,7 +437,7 @@ bool Object::define_accessor(PropertyName property_name, Function& getter_or_set
|
|||
accessor = &existing_property.as_accessor();
|
||||
}
|
||||
if (!accessor) {
|
||||
accessor = Accessor::create(interpreter(), nullptr, nullptr);
|
||||
accessor = Accessor::create(interpreter(), global_object(), nullptr, nullptr);
|
||||
bool definition_success = define_property(property_name, accessor, attributes, throw_exceptions);
|
||||
if (interpreter().exception())
|
||||
return {};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue