diff options
author | Linus Groh <mail@linusgroh.de> | 2021-07-04 01:07:40 +0100 |
---|---|---|
committer | Linus Groh <mail@linusgroh.de> | 2021-07-04 22:07:36 +0100 |
commit | a3c8ebd709784114d63a1bd79eabb9135d20a639 (patch) | |
tree | 5cc8007d3aec71d0f5d6574d361f1298db34e4b9 /Userland | |
parent | 1ac3d253c5238fcdbb18f3759737f3b3bda95e27 (diff) | |
download | serenity-a3c8ebd709784114d63a1bd79eabb9135d20a639.zip |
LibJS: VERIFY() that property name is valid in Value::get{,_method}()
Diffstat (limited to 'Userland')
-rw-r--r-- | Userland/Libraries/LibJS/Runtime/Value.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/Userland/Libraries/LibJS/Runtime/Value.cpp b/Userland/Libraries/LibJS/Runtime/Value.cpp index 4c8f97a5bb..a622beb72c 100644 --- a/Userland/Libraries/LibJS/Runtime/Value.cpp +++ b/Userland/Libraries/LibJS/Runtime/Value.cpp @@ -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()); |