mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 04:07:44 +00:00
LibJS: Remove Object::value_of()
Being really close to Object.prototype.valueOf() name wise makes this unnecessarily confusing - while it sometimes serves as the implementation of a valueOf() function, it's an abstraction which the spec doesn't have. Use the appropriate getters to retrieve specific internal slots instead, most commonly [[FooData]] from the primitive wrapper objects. For the Object class specifically, use the Value(Object*) ctor instead.
This commit is contained in:
parent
07c5419a82
commit
038d354b5d
14 changed files with 20 additions and 38 deletions
|
@ -166,9 +166,8 @@ static JS::ThrowCompletionOr<DOM::Window*> impl_from(JS::VM& vm, JS::GlobalObjec
|
|||
// the global object we make an exception here.
|
||||
// This allows calls like `setTimeout(f, 10)` to work.
|
||||
auto this_value = vm.this_value(global_object);
|
||||
if (this_value.is_nullish()) {
|
||||
this_value = global_object.value_of();
|
||||
}
|
||||
if (this_value.is_nullish())
|
||||
this_value = &global_object;
|
||||
|
||||
auto* this_object = MUST(this_value.to_object(global_object));
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue