mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 15:40:19 +00:00
LibJS: Fix base64 decoder typo
Some checks are pending
CI / Lagom (false, FUZZ, ubuntu-24.04, Linux, Clang) (push) Waiting to run
CI / Lagom (false, NO_FUZZ, macos-14, macOS, Clang) (push) Waiting to run
CI / Lagom (false, NO_FUZZ, ubuntu-24.04, Linux, GNU) (push) Waiting to run
CI / Lagom (true, NO_FUZZ, ubuntu-24.04, Linux, Clang) (push) Waiting to run
Package the js repl as a binary artifact / build-and-package (macos-14, macOS, macOS-universal2) (push) Waiting to run
Package the js repl as a binary artifact / build-and-package (ubuntu-24.04, Linux, Linux-x86_64) (push) Waiting to run
Run test262 and test-wasm / run_and_update_results (push) Waiting to run
Lint Code / lint (push) Waiting to run
Push notes / build (push) Waiting to run
Some checks are pending
CI / Lagom (false, FUZZ, ubuntu-24.04, Linux, Clang) (push) Waiting to run
CI / Lagom (false, NO_FUZZ, macos-14, macOS, Clang) (push) Waiting to run
CI / Lagom (false, NO_FUZZ, ubuntu-24.04, Linux, GNU) (push) Waiting to run
CI / Lagom (true, NO_FUZZ, ubuntu-24.04, Linux, Clang) (push) Waiting to run
Package the js repl as a binary artifact / build-and-package (macos-14, macOS, macOS-universal2) (push) Waiting to run
Package the js repl as a binary artifact / build-and-package (ubuntu-24.04, Linux, Linux-x86_64) (push) Waiting to run
Run test262 and test-wasm / run_and_update_results (push) Waiting to run
Lint Code / lint (push) Waiting to run
Push notes / build (push) Waiting to run
As the comments suggest, _ is supposed to be translated into / but - is translated twice instead
This commit is contained in:
parent
84ad36de06
commit
0cc8ba305d
Notes:
github-actions[bot]
2024-10-23 23:48:11 +00:00
Author: https://github.com/shlyakpavel 🔰 Commit: https://github.com/LadybirdBrowser/ladybird/commit/0cc8ba305d6 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/1922 Reviewed-by: https://github.com/trflynn89 ✅
2 changed files with 20 additions and 1 deletions
|
@ -729,7 +729,7 @@ DecodeResult from_base64(VM& vm, StringView string, Alphabet alphabet, LastChunk
|
||||||
ch = '+';
|
ch = '+';
|
||||||
}
|
}
|
||||||
// iii. Else if char is "_", then
|
// iii. Else if char is "_", then
|
||||||
else if (ch == '-') {
|
else if (ch == '_') {
|
||||||
// 1. Set char to "/".
|
// 1. Set char to "/".
|
||||||
ch = '/';
|
ch = '/';
|
||||||
}
|
}
|
||||||
|
|
|
@ -108,6 +108,25 @@ describe("correct behavior", () => {
|
||||||
|
|
||||||
decodeEqual("8J-kkw==", "🤓", options);
|
decodeEqual("8J-kkw==", "🤓", options);
|
||||||
decodeEqual("8J-kk2Zvb_CflpY=", "🤓foo🖖", options);
|
decodeEqual("8J-kk2Zvb_CflpY=", "🤓foo🖖", options);
|
||||||
|
|
||||||
|
decodeEqual("b2g_", "oh?", options);
|
||||||
|
});
|
||||||
|
|
||||||
|
test("strict mode with base64url alphabet", () => {
|
||||||
|
const options = { alphabet: "base64url", lastChunkHandling: "strict" };
|
||||||
|
|
||||||
|
decodeEqual("", "", options);
|
||||||
|
decodeEqual("Zg==", "f", options);
|
||||||
|
decodeEqual("Zm8=", "fo", options);
|
||||||
|
decodeEqual("Zm9v", "foo", options);
|
||||||
|
decodeEqual("Zm9vYg==", "foob", options);
|
||||||
|
decodeEqual("Zm9vYmE=", "fooba", options);
|
||||||
|
decodeEqual("Zm9vYmFy", "foobar", options);
|
||||||
|
|
||||||
|
decodeEqual("8J-kkw==", "🤓", options);
|
||||||
|
decodeEqual("8J-kk2Zvb_CflpY=", "🤓foo🖖", options);
|
||||||
|
|
||||||
|
decodeEqual("b2g_", "oh?", options);
|
||||||
});
|
});
|
||||||
|
|
||||||
test("stop-before-partial lastChunkHandling", () => {
|
test("stop-before-partial lastChunkHandling", () => {
|
||||||
|
|
Loading…
Reference in a new issue