mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-06 16:45:03 +00:00
LibJS: Implement Uint8Array.prototype.toBase64
This commit is contained in:
committed by
Andreas Kling
parent
dfad1a7329
commit
b97f9f2c55
30
Userland/Libraries/LibJS/Runtime/Uint8Array.h
Normal file
30
Userland/Libraries/LibJS/Runtime/Uint8Array.h
Normal file
@@ -0,0 +1,30 @@
|
||||
/*
|
||||
* Copyright (c) 2024, Tim Flynn <trflynn89@serenityos.org>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <LibJS/Forward.h>
|
||||
#include <LibJS/Heap/GCPtr.h>
|
||||
|
||||
namespace JS {
|
||||
|
||||
class Uint8ArrayPrototypeHelpers {
|
||||
public:
|
||||
static void initialize(Realm&, Object& prototype);
|
||||
|
||||
private:
|
||||
JS_DECLARE_NATIVE_FUNCTION(to_base64);
|
||||
};
|
||||
|
||||
enum class Alphabet {
|
||||
Base64,
|
||||
Base64URL,
|
||||
};
|
||||
|
||||
ThrowCompletionOr<NonnullGCPtr<TypedArrayBase>> validate_uint8_array(VM&);
|
||||
ThrowCompletionOr<ByteBuffer> get_uint8_array_bytes(VM&, TypedArrayBase const&);
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user