Everywhere: Hoist the Libraries folder to the top-level

This commit is contained in:
Timothy Flynn 2024-11-09 12:25:08 -05:00 committed by Andreas Kling
commit 93712b24bf
Notes: github-actions[bot] 2024-11-10 11:51:52 +00:00
4547 changed files with 104 additions and 113 deletions

View file

@ -0,0 +1,49 @@
/*
* Copyright (c) 2021, Idan Horowitz <idan.horowitz@serenityos.org>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#pragma once
#include <LibJS/Runtime/ArrayBuffer.h>
#include <LibJS/Runtime/ByteLength.h>
#include <LibJS/Runtime/GlobalObject.h>
#include <LibJS/Runtime/Object.h>
namespace JS {
class DataView : public Object {
JS_OBJECT(DataView, Object);
JS_DECLARE_ALLOCATOR(DataView);
public:
static NonnullGCPtr<DataView> create(Realm&, ArrayBuffer*, ByteLength byte_length, size_t byte_offset);
virtual ~DataView() override = default;
ArrayBuffer* viewed_array_buffer() const { return m_viewed_array_buffer; }
ByteLength const& byte_length() const { return m_byte_length; }
u32 byte_offset() const { return m_byte_offset; }
private:
DataView(ArrayBuffer*, ByteLength byte_length, size_t byte_offset, Object& prototype);
virtual void visit_edges(Visitor& visitor) override;
GCPtr<ArrayBuffer> m_viewed_array_buffer;
ByteLength m_byte_length { 0 };
size_t m_byte_offset { 0 };
};
// 25.3.1.1 DataView With Buffer Witness Records, https://tc39.es/ecma262/#sec-dataview-with-buffer-witness-records
struct DataViewWithBufferWitness {
NonnullGCPtr<DataView const> object; // [[Object]]
ByteLength cached_buffer_byte_length; // [[CachedBufferByteLength]]
};
DataViewWithBufferWitness make_data_view_with_buffer_witness_record(DataView const&, ArrayBuffer::Order);
u32 get_view_byte_length(DataViewWithBufferWitness const&);
bool is_view_out_of_bounds(DataViewWithBufferWitness const&);
}