1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 11:38:11 +00:00
serenity/Userland/Libraries/LibJS
Idan Horowitz b9d9187feb LibJS: Automatically & lazily coerce PropertyNames into numbers
This commit expands on 5eef07d232 by
automatically trying to coerce Type::String PropertyNames into numbers
when a caller checks if the PropertyName is_number/is_string.
This has several benefits:
 - We no longer have to duplicate the number coercion code to every
   function that accepts a PropertyNumber. (Or more likely, forget to.)
 - This keeps the lazy nature of only doing the coercion when and if
   there is a semantic difference to the different PropertyName types,
   which means this shouldnt cause any performance drop.
 - Since this coercion changes the state of the PropertyName itself the
   result is essentially cached and can speed up any repeat uses of the
   same PropertyName instance.
2021-06-16 22:54:48 +01:00
..
Bytecode LibJS: Replace Object's create_empty() with create() taking a prototype 2021-06-16 22:49:04 +01:00
Heap LibJS: Don't generate unused HeapBlock names on non-SerenityOS systems 2021-06-13 19:11:29 +02:00
Runtime LibJS: Automatically & lazily coerce PropertyNames into numbers 2021-06-16 22:54:48 +01:00
Tests LibJS/Tests: Use Object.prototype.toString() for values in test details 2021-06-16 22:49:04 +01:00
AST.cpp LibJS: Replace Object's create_empty() with create() taking a prototype 2021-06-16 22:49:04 +01:00
AST.h LibJS: Correctly parse yield-from expressions 2021-06-14 13:06:08 +01:00
CMakeLists.txt LibJS: Add the FinalizationRegistry built-in object 2021-06-15 23:59:21 +01:00
Console.cpp Everywhere: Use linusg@serenityos.org for my copyright headers 2021-04-22 22:51:19 +02:00
Console.h Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
Forward.h LibJS: Add the FinalizationRegistry built-in object 2021-06-15 23:59:21 +01:00
Interpreter.cpp LibJS: Add the FinalizationRegistry built-in object 2021-06-15 23:59:21 +01:00
Interpreter.h Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
Lexer.cpp LibJS: Add support for hex, octal & binary big integer literals 2021-06-14 01:45:04 +01:00
Lexer.h Userland: Allow building SerenityOS with -funsigned-char 2021-06-13 18:52:58 +02:00
MarkupGenerator.cpp LibJS: Avoid lots of string-to-int during global object construction 2021-06-13 19:11:29 +02:00
MarkupGenerator.h Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
Parser.cpp LibJS: Correctly parse yield-from expressions 2021-06-14 13:06:08 +01:00
Parser.h LibJS: Correctly parse yield-from expressions 2021-06-14 13:06:08 +01:00
SourceRange.h Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
SyntaxHighlighter.cpp LibWeb+LibSyntax: Implement nested syntax highlighters 2021-06-07 14:45:49 +04:30
SyntaxHighlighter.h LibWeb+LibSyntax: Implement nested syntax highlighters 2021-06-07 14:45:49 +04:30
Token.cpp LibJS: Use the new is_ascii_foo() helpers from AK 2021-06-13 19:11:29 +02:00
Token.h Everywhere: Use s.unverwerth@serenityos.org :^) 2021-05-29 12:30:08 +01:00