From 148c4161d9d181fbb65d96a7240e4cc267347d10 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Mon, 5 Oct 2020 20:48:26 +0200 Subject: [PATCH] LibJS: Avoid work in Shape::lookup() if there are no properties --- Libraries/LibJS/Runtime/Shape.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Libraries/LibJS/Runtime/Shape.cpp b/Libraries/LibJS/Runtime/Shape.cpp index d30c701c60..741e00e322 100644 --- a/Libraries/LibJS/Runtime/Shape.cpp +++ b/Libraries/LibJS/Runtime/Shape.cpp @@ -114,6 +114,8 @@ void Shape::visit_children(Cell::Visitor& visitor) Optional Shape::lookup(const StringOrSymbol& property_name) const { + if (m_property_count == 0) + return {}; auto property = property_table().get(property_name); if (!property.has_value()) return {};