mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 18:47:34 +00:00
AK: Make encode_base64 take a ByteBuffer and return a String
That makes the interface symmetric with decode_base64 and it's what all current callers want (except for one, which is buggy).
This commit is contained in:
parent
9e32ad6c99
commit
5ba8aba197
5 changed files with 15 additions and 13 deletions
|
@ -267,8 +267,8 @@ JS_DEFINE_NATIVE_FUNCTION(WindowObject::btoa)
|
|||
if (interpreter.exception())
|
||||
return {};
|
||||
// FIXME: This should convert string to a non-UTF-8 byte string first.
|
||||
auto encoded = encode_base64(StringView(string));
|
||||
return JS::js_string(interpreter, String::copy(encoded));
|
||||
auto encoded = encode_base64(ByteBuffer::wrap(string.characters(), string.length()));
|
||||
return JS::js_string(interpreter, move(encoded));
|
||||
}
|
||||
|
||||
JS_DEFINE_NATIVE_GETTER(WindowObject::document_getter)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue