1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 10:08:12 +00:00
serenity/Libraries/LibJS
Matthew Olsson 5ae9419a06 LibJS: Object index properties have descriptors; Handle sparse indices
This patch adds an IndexedProperties object for storing indexed
properties within an Object. This accomplishes two goals: indexed
properties now have an associated descriptor, and objects now gracefully
handle sparse properties.

The IndexedProperties class is a wrapper around two other classes, one
for simple indexed properties storage, and one for general indexed
property storage. Simple indexed property storage is the common-case,
and is simply a vector of properties which all have attributes of
default_attributes (writable, enumerable, and configurable).

General indexed property storage is for a collection of indexed
properties where EITHER one or more properties have attributes other
than default_attributes OR there is a property with a large index (in
particular, large is '200' or higher).

Indexed properties are now treated relatively the same as storage within
the various Object methods. Additionally, there is a custom iterator
class for IndexedProperties which makes iteration easy. The iterator
skips empty values by default, but can be configured otherwise.
Likewise, it evaluates getters by default, but can be set not to.
2020-05-28 17:17:13 +02:00
..
Heap LibJS: Use __APPLE__ instead of __MACH__ for MacOS build 2020-05-23 18:09:07 +02:00
Runtime LibJS: Object index properties have descriptors; Handle sparse indices 2020-05-28 17:17:13 +02:00
Tests LibJS: Object index properties have descriptors; Handle sparse indices 2020-05-28 17:17:13 +02:00
AST.cpp LibJS: Object index properties have descriptors; Handle sparse indices 2020-05-28 17:17:13 +02:00
AST.h LibJS: Fix style inconsistencies in AST.h (#2403) 2020-05-26 19:52:03 +02:00
CMakeLists.txt LibJS: Object index properties have descriptors; Handle sparse indices 2020-05-28 17:17:13 +02:00
Console.cpp LibJS: Add side-effect-free version of Value::to_string() 2020-05-15 13:50:42 +02:00
Console.h LibJS: Implement ConsoleClient 2020-05-05 09:15:16 +02:00
Forward.h LibJS: Create JS to HTML markup generator 2020-05-26 10:17:50 +02:00
Interpreter.cpp LibJS: Only log exception throw information on Serenity 2020-05-26 14:36:30 +02:00
Interpreter.h Browser: Add JS Console 2020-05-24 02:20:08 +02:00
Lexer.cpp LibJS: Fix incorrect token column values (#2401) 2020-05-26 19:00:30 +02:00
Lexer.h LibJS: Fix incorrect token column values (#2401) 2020-05-26 19:00:30 +02:00
MarkupGenerator.cpp LibJS: Object index properties have descriptors; Handle sparse indices 2020-05-28 17:17:13 +02:00
MarkupGenerator.h Browser: Add output styles to JS source printed in the console 2020-05-26 10:17:50 +02:00
Parser.cpp LibJS: Implement basic for..in and for..of loops 2020-05-25 18:45:36 +02:00
Parser.h LibJS: Fix out-of-range error in Parser::Error::source_location_hint 2020-05-28 17:02:16 +02:00
Token.cpp LibJS: Handle hex and unicode escape sequences in string literals 2020-05-18 17:58:17 +02:00
Token.h LibJS: Handle hex and unicode escape sequences in string literals 2020-05-18 17:58:17 +02:00