mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 11:47:45 +00:00
LibJS: VERIFY() that property name is valid in Value::get{,_method}()
This commit is contained in:
parent
1ac3d253c5
commit
a3c8ebd709
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();
|
auto& vm = global_object.vm();
|
||||||
|
|
||||||
// 1. Assert: IsPropertyKey(P) is true.
|
// 1. Assert: IsPropertyKey(P) is true.
|
||||||
|
VERIFY(property_name.is_valid());
|
||||||
|
|
||||||
// 2. Let O be ? ToObject(V).
|
// 2. Let O be ? ToObject(V).
|
||||||
auto* object = to_object(global_object);
|
auto* object = to_object(global_object);
|
||||||
|
@ -815,6 +816,7 @@ FunctionObject* Value::get_method(GlobalObject& global_object, PropertyName cons
|
||||||
auto& vm = global_object.vm();
|
auto& vm = global_object.vm();
|
||||||
|
|
||||||
// 1. Assert: IsPropertyKey(P) is true.
|
// 1. Assert: IsPropertyKey(P) is true.
|
||||||
|
VERIFY(property_name.is_valid());
|
||||||
|
|
||||||
// 2. Let func be ? GetV(V, P).
|
// 2. Let func be ? GetV(V, P).
|
||||||
auto function = get(global_object, property_name).value_or(js_undefined());
|
auto function = get(global_object, property_name).value_or(js_undefined());
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue