mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-02 14:19:48 +00:00
LibJS: Remove default constructor of PropertyKey
This constructor was creating an "invalid" `PropertyKey`, but every code path constructing such a `PropertyKey` was either never used or immediately `VERIFY`ing that the `PropertyKey` was valid. The `VERIFY` call has been moved to the `PropertyKey::from_value(...)` call, and the array/object literal spreading code could be refactored to not take a `PropertyKey` but creates dummy values for now. The default constructor for `Reference` has similairly be deleted, because it was never used.
This commit is contained in:
parent
1d8e62926f
commit
27859c17b4
Notes:
github-actions[bot]
2024-11-09 16:56:10 +00:00
Author: https://github.com/yyny
Commit: 27859c17b4
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/2120
Reviewed-by: https://github.com/trflynn89
5 changed files with 30 additions and 42 deletions
|
@ -1362,7 +1362,7 @@ inline ThrowCompletionOr<void> put_by_value(VM& vm, Value base, Optional<Depreca
|
|||
}
|
||||
}
|
||||
|
||||
auto property_key = kind != Op::PropertyKind::Spread ? TRY(property_key_value.to_property_key(vm)) : PropertyKey {};
|
||||
auto property_key = kind != Op::PropertyKind::Spread ? TRY(property_key_value.to_property_key(vm)) : PropertyKey { 0 };
|
||||
TRY(put_by_property_key(vm, base, base, value, base_identifier, property_key, kind));
|
||||
return {};
|
||||
}
|
||||
|
@ -2807,7 +2807,7 @@ ThrowCompletionOr<void> PutByValueWithThis::execute_impl(Bytecode::Interpreter&
|
|||
auto& vm = interpreter.vm();
|
||||
auto value = interpreter.get(m_src);
|
||||
auto base = interpreter.get(m_base);
|
||||
auto property_key = m_kind != PropertyKind::Spread ? TRY(interpreter.get(m_property).to_property_key(vm)) : PropertyKey {};
|
||||
auto property_key = m_kind != PropertyKind::Spread ? TRY(interpreter.get(m_property).to_property_key(vm)) : PropertyKey { 0 };
|
||||
TRY(put_by_property_key(vm, base, interpreter.get(m_this_value), value, {}, property_key, m_kind));
|
||||
return {};
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue