LibJS: VERIFY() that property name is valid in Value::get{,_method}()
This commit is contained in:
parent
1ac3d253c5
commit
a3c8ebd709
Notes:
sideshowbarker
2024-07-18 10:26:58 +09:00
Author: https://github.com/linusg Commit: https://github.com/SerenityOS/serenity/commit/a3c8ebd7097 Pull-request: https://github.com/SerenityOS/serenity/pull/8262 Reviewed-by: https://github.com/IdanHo Reviewed-by: https://github.com/alimpfard ✅ Reviewed-by: https://github.com/awesomekling ✅ Reviewed-by: https://github.com/davidot Reviewed-by: https://github.com/mattco98
1 changed files with 2 additions and 0 deletions
|
@ -799,6 +799,7 @@ Value Value::get(GlobalObject& global_object, PropertyName const& property_name)
|
|||
auto& vm = global_object.vm();
|
||||
|
||||
// 1. Assert: IsPropertyKey(P) is true.
|
||||
VERIFY(property_name.is_valid());
|
||||
|
||||
// 2. Let O be ? ToObject(V).
|
||||
auto* object = to_object(global_object);
|
||||
|
@ -815,6 +816,7 @@ FunctionObject* Value::get_method(GlobalObject& global_object, PropertyName cons
|
|||
auto& vm = global_object.vm();
|
||||
|
||||
// 1. Assert: IsPropertyKey(P) is true.
|
||||
VERIFY(property_name.is_valid());
|
||||
|
||||
// 2. Let func be ? GetV(V, P).
|
||||
auto function = get(global_object, property_name).value_or(js_undefined());
|
||||
|
|
Loading…
Add table
Reference in a new issue