1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-20 14:15:07 +00:00
serenity/Userland/Libraries/LibJS
Linus Groh 3a4cbbf01c LibJS: Fix indexed access of TypedArray with byte offset
By doing the offset calculation in {get,put}_by_index() we would
delegate these operations to Object for any index >= (array length -
byte offset). By doing the offset calculation in data() instead, we can
just use the unaltered property index for indexing the returned Span.
In other words: data()[0] now returns the same value as indexing the
TypedArray at index 0 in JS.

This also fixes a bug in the js REPL which would not consider the byte
offset and subsequently access the underlying ArrayBuffer data with a
wrong index.
2021-05-21 19:29:23 +01:00
..
Heap LibJS: Don't consider cells in the lazy freelist in conservative scan 2021-05-17 19:57:40 +02:00
Runtime LibJS: Fix indexed access of TypedArray with byte offset 2021-05-21 19:29:23 +01:00
Tests LibJS: Implement Object.hasOwn() :^) 2021-05-18 11:18:19 +02:00
AST.cpp LibJS: Make super() in catch block work 2021-05-11 23:31:30 +01:00
AST.h LibJS: Rename RegExpLiteral m_content to m_pattern 2021-05-10 11:57:35 +01:00
CMakeLists.txt LibJS: Move Cell.{cpp,h} from Runtime/ to Heap/ 2021-05-17 19:53:00 +02: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 Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
Interpreter.cpp LibJS: Ensure function declarations don't leak outside function scopes 2021-05-13 23:59:00 +01:00
Interpreter.h Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
Lexer.cpp Everywhere: Use linusg@serenityos.org for my copyright headers 2021-04-22 22:51:19 +02:00
Lexer.h Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
MarkupGenerator.cpp Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
MarkupGenerator.h Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
Parser.cpp LibJS: Make invalid RegExp flags a SyntaxError at parse time 2021-05-10 12:01:38 +01:00
Parser.h Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
SourceRange.h Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
SyntaxHighlighter.cpp Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
SyntaxHighlighter.h Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
Token.cpp Everywhere: Use linusg@serenityos.org for my copyright headers 2021-04-22 22:51:19 +02:00
Token.h Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00