1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-18 18:35:06 +00:00
serenity/Libraries/LibJS
Nico Weber b9ce56aee6 LibWeb: Make btoa() and atob() correctly handle values between 128 and 255
btoa() takes a byte string, so it must decode the UTF-8 argument into
a Vector<u8> before calling encode_base64.

Likewise, in atob() decode_base64 returns a byte string, so that needs
to be converted to UTF-8.

With this, `btoa(String.fromCharCode(255))` is '/w==' as it should
be, and `atob(btoa(String.fromCharCode(255))) == String.fromCharCode(255)`
remains true.
2020-07-22 19:22:00 +02:00
..
Heap LibJS: Move native objects towards two-pass construction 2020-06-20 15:46:30 +02:00
Runtime LibWeb: Make btoa() and atob() correctly handle values between 128 and 255 2020-07-22 19:22:00 +02:00
Tests LibJS: Fix \x escapes of bytes with high bit set 2020-07-22 19:21:35 +02:00
AST.cpp LibJS: Integrate iterator protocol into language features 2020-07-14 17:58:42 +02:00
AST.h LibJS: Initial class implementation; allow super expressions in object 2020-06-29 17:54:54 +02:00
CMakeLists.txt LibJS: Add StringIterator 2020-07-13 15:07:29 +02:00
Console.cpp LibJS: Move Interpreter::get_trace() to ConsoleClient 2020-06-02 15:22:34 +02:00
Console.h LibJS: Move Interpreter::get_trace() to ConsoleClient 2020-06-02 15:22:34 +02:00
Forward.h LibWeb: Make btoa() and atob() correctly handle values between 128 and 255 2020-07-22 19:22:00 +02:00
Interpreter.cpp LibJS: Use macros to enumerate well-known symbols 2020-07-11 18:54:13 +02:00
Interpreter.h LibJS: Use macros to enumerate well-known symbols 2020-07-11 18:54:13 +02:00
Lexer.cpp LibJS: Move regex logic to main Lexer if statement 2020-06-08 09:18:27 +02:00
Lexer.h LibJS: Lex and parse regex literals, add RegExp objects 2020-06-07 19:06:55 +02:00
MarkupGenerator.cpp LibJS: Integrate Symbols into objects as valid keys 2020-07-09 23:33:00 +02:00
MarkupGenerator.h Meta: Add a script check the presence of "#pragma once" in header files 2020-05-29 07:59:45 +02:00
Parser.cpp LibJS: Initial class implementation; allow super expressions in object 2020-06-29 17:54:54 +02:00
Parser.h LibJS: Initial class implementation; allow super expressions in object 2020-06-29 17:54:54 +02:00
Token.cpp LibJS: Fix \x escapes of bytes with high bit set 2020-07-22 19:21:35 +02:00
Token.h LibJS: Add BigInt 2020-06-07 19:29:40 +02:00