mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-29 12:19:54 +00:00
LibJS: Enable EXPLICIT_SYMBOL_EXPORT and annotate minimum symbol set
This commit is contained in:
parent
539a675802
commit
2e2484257d
Notes:
github-actions[bot]
2025-07-22 15:52:50 +00:00
Author: https://github.com/ayeteadoe
Commit: 2e2484257d
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/5525
Reviewed-by: https://github.com/trflynn89 ✅
61 changed files with 167 additions and 124 deletions
|
@ -21,6 +21,7 @@
|
|||
#include <LibJS/Bytecode/Op.h>
|
||||
#include <LibJS/Bytecode/Operand.h>
|
||||
#include <LibJS/Bytecode/ScopedOperand.h>
|
||||
#include <LibJS/Export.h>
|
||||
#include <LibJS/Forward.h>
|
||||
#include <LibJS/LocalVariable.h>
|
||||
#include <LibJS/Runtime/ClassFieldDefinition.h>
|
||||
|
@ -292,7 +293,7 @@ public:
|
|||
}
|
||||
};
|
||||
|
||||
class ScopeNode : public Statement {
|
||||
class JS_API ScopeNode : public Statement {
|
||||
public:
|
||||
template<typename T, typename... Args>
|
||||
T& append(SourceRange range, Args&&... args)
|
||||
|
|
|
@ -15,6 +15,7 @@
|
|||
#include <LibJS/Bytecode/IdentifierTable.h>
|
||||
#include <LibJS/Bytecode/Label.h>
|
||||
#include <LibJS/Bytecode/StringTable.h>
|
||||
#include <LibJS/Export.h>
|
||||
#include <LibJS/Forward.h>
|
||||
#include <LibJS/Heap/Cell.h>
|
||||
#include <LibJS/LocalVariable.h>
|
||||
|
@ -47,7 +48,7 @@ struct SourceRecord {
|
|||
u32 source_end_offset {};
|
||||
};
|
||||
|
||||
class Executable final : public Cell {
|
||||
class JS_API Executable final : public Cell {
|
||||
GC_CELL(Executable, Cell);
|
||||
GC_DECLARE_ALLOCATOR(Executable);
|
||||
|
||||
|
|
|
@ -9,6 +9,7 @@
|
|||
#include <LibJS/Bytecode/Executable.h>
|
||||
#include <LibJS/Bytecode/Label.h>
|
||||
#include <LibJS/Bytecode/Register.h>
|
||||
#include <LibJS/Export.h>
|
||||
#include <LibJS/Forward.h>
|
||||
#include <LibJS/Heap/Cell.h>
|
||||
#include <LibJS/Runtime/FunctionKind.h>
|
||||
|
@ -19,7 +20,7 @@ namespace JS::Bytecode {
|
|||
|
||||
class InstructionStreamIterator;
|
||||
|
||||
class Interpreter {
|
||||
class JS_API Interpreter {
|
||||
public:
|
||||
explicit Interpreter(VM&);
|
||||
~Interpreter();
|
||||
|
|
|
@ -266,7 +266,7 @@ set(SOURCES
|
|||
Token.cpp
|
||||
)
|
||||
|
||||
ladybird_lib(LibJS js)
|
||||
ladybird_lib(LibJS js EXPLICIT_SYMBOL_EXPORT)
|
||||
target_link_libraries(LibJS PRIVATE LibCore LibCrypto LibFileSystem LibRegex LibSyntax LibGC)
|
||||
|
||||
# Link LibUnicode publicly to ensure ICU data (which is in libicudata.a) is available in any process using LibJS.
|
||||
|
|
|
@ -14,6 +14,7 @@
|
|||
#include <AK/Vector.h>
|
||||
#include <LibCore/ElapsedTimer.h>
|
||||
#include <LibGC/CellAllocator.h>
|
||||
#include <LibJS/Export.h>
|
||||
#include <LibJS/Forward.h>
|
||||
#include <LibJS/Heap/Cell.h>
|
||||
#include <LibJS/Runtime/Value.h>
|
||||
|
@ -23,7 +24,7 @@ namespace JS {
|
|||
class ConsoleClient;
|
||||
|
||||
// https://console.spec.whatwg.org
|
||||
class Console : public Cell {
|
||||
class JS_API Console : public Cell {
|
||||
GC_CELL(Console, Cell);
|
||||
GC_DECLARE_ALLOCATOR(Console);
|
||||
|
||||
|
@ -105,7 +106,7 @@ private:
|
|||
Vector<Group> m_group_stack;
|
||||
};
|
||||
|
||||
class ConsoleClient : public Cell {
|
||||
class JS_API ConsoleClient : public Cell {
|
||||
GC_CELL(ConsoleClient, Cell);
|
||||
GC_DECLARE_ALLOCATOR(ConsoleClient);
|
||||
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include <LibJS/Export.h>
|
||||
#include <LibJS/Forward.h>
|
||||
#include <LibJS/Module.h>
|
||||
|
||||
|
@ -23,7 +24,7 @@ enum class ModuleStatus {
|
|||
};
|
||||
|
||||
// 16.2.1.5 Cyclic Module Records, https://tc39.es/ecma262/#cyclic-module-record
|
||||
class CyclicModule : public Module {
|
||||
class JS_API CyclicModule : public Module {
|
||||
GC_CELL(CyclicModule, Module);
|
||||
GC_DECLARE_ALLOCATOR(CyclicModule);
|
||||
|
||||
|
|
|
@ -7,11 +7,12 @@
|
|||
#pragma once
|
||||
|
||||
#include <LibGC/Cell.h>
|
||||
#include <LibJS/Export.h>
|
||||
#include <LibJS/Forward.h>
|
||||
|
||||
namespace JS {
|
||||
|
||||
class Cell : public GC::Cell {
|
||||
class JS_API Cell : public GC::Cell {
|
||||
GC_CELL(Cell, GC::Cell);
|
||||
|
||||
public:
|
||||
|
|
|
@ -12,10 +12,11 @@
|
|||
#include <AK/HashMap.h>
|
||||
#include <AK/String.h>
|
||||
#include <AK/StringView.h>
|
||||
#include <LibJS/Export.h>
|
||||
|
||||
namespace JS {
|
||||
|
||||
class Lexer {
|
||||
class JS_API Lexer {
|
||||
public:
|
||||
explicit Lexer(StringView source, StringView filename = "(unknown)"sv, size_t line_number = 1, size_t line_column = 0);
|
||||
|
||||
|
|
|
@ -9,6 +9,7 @@
|
|||
|
||||
#include <AK/FlyString.h>
|
||||
#include <LibGC/Ptr.h>
|
||||
#include <LibJS/Export.h>
|
||||
#include <LibJS/ModuleLoading.h>
|
||||
#include <LibJS/Runtime/Environment.h>
|
||||
#include <LibJS/Runtime/Realm.h>
|
||||
|
@ -150,6 +151,6 @@ private:
|
|||
class CyclicModule;
|
||||
struct GraphLoadingState;
|
||||
|
||||
void finish_loading_imported_module(ImportedModuleReferrer, ModuleRequest const&, ImportedModulePayload, ThrowCompletionOr<GC::Ref<Module>> const&);
|
||||
JS_API void finish_loading_imported_module(ImportedModuleReferrer, ModuleRequest const&, ImportedModulePayload, ThrowCompletionOr<GC::Ref<Module>> const&);
|
||||
|
||||
}
|
||||
|
|
|
@ -5205,7 +5205,7 @@ Parser::ForbiddenTokens Parser::ForbiddenTokens::forbid(std::initializer_list<To
|
|||
return result;
|
||||
}
|
||||
|
||||
template NonnullRefPtr<FunctionExpression> Parser::parse_function_node(u16, Optional<Position> const&);
|
||||
template JS_API NonnullRefPtr<FunctionExpression> Parser::parse_function_node(u16, Optional<Position> const&);
|
||||
template NonnullRefPtr<FunctionDeclaration> Parser::parse_function_node(u16, Optional<Position> const&);
|
||||
|
||||
NonnullRefPtr<Identifier const> Parser::create_identifier_and_register_in_current_scope(SourceRange range, FlyString string, Optional<DeclarationKind> declaration_kind)
|
||||
|
|
|
@ -13,6 +13,7 @@
|
|||
#include <AK/NonnullRefPtr.h>
|
||||
#include <AK/StringBuilder.h>
|
||||
#include <LibJS/AST.h>
|
||||
#include <LibJS/Export.h>
|
||||
#include <LibJS/Lexer.h>
|
||||
#include <LibJS/ParserError.h>
|
||||
#include <LibJS/Runtime/FunctionConstructor.h>
|
||||
|
@ -45,7 +46,7 @@ struct FunctionNodeParseOptions {
|
|||
|
||||
class ScopePusher;
|
||||
|
||||
class Parser {
|
||||
class JS_API Parser {
|
||||
public:
|
||||
struct EvalInitialState {
|
||||
bool in_eval_function_context { false };
|
||||
|
|
|
@ -11,11 +11,12 @@
|
|||
#include <AK/Error.h>
|
||||
#include <AK/Optional.h>
|
||||
#include <AK/String.h>
|
||||
#include <LibJS/Export.h>
|
||||
#include <LibJS/SourceRange.h>
|
||||
|
||||
namespace JS {
|
||||
|
||||
struct ParserError {
|
||||
struct JS_API ParserError {
|
||||
String message;
|
||||
Optional<Position> position;
|
||||
|
||||
|
|
|
@ -9,6 +9,7 @@
|
|||
#pragma once
|
||||
|
||||
#include <AK/HashTable.h>
|
||||
#include <LibJS/Export.h>
|
||||
#include <LibJS/Runtime/Value.h>
|
||||
|
||||
namespace JS {
|
||||
|
@ -20,6 +21,6 @@ struct PrintContext {
|
|||
bool raw_strings { false };
|
||||
};
|
||||
|
||||
ErrorOr<void> print(JS::Value value, PrintContext&);
|
||||
JS_API ErrorOr<void> print(JS::Value value, PrintContext&);
|
||||
|
||||
}
|
||||
|
|
|
@ -10,6 +10,7 @@
|
|||
#include <AK/Forward.h>
|
||||
#include <LibCrypto/Forward.h>
|
||||
#include <LibGC/RootVector.h>
|
||||
#include <LibJS/Export.h>
|
||||
#include <LibJS/Forward.h>
|
||||
#include <LibJS/Runtime/CanonicalIndex.h>
|
||||
#include <LibJS/Runtime/Environment.h>
|
||||
|
@ -24,29 +25,29 @@
|
|||
namespace JS {
|
||||
|
||||
GC::Ref<DeclarativeEnvironment> new_declarative_environment(Environment&);
|
||||
GC::Ref<ObjectEnvironment> new_object_environment(Object&, bool is_with_environment, Environment*);
|
||||
JS_API GC::Ref<ObjectEnvironment> new_object_environment(Object&, bool is_with_environment, Environment*);
|
||||
GC::Ref<FunctionEnvironment> new_function_environment(ECMAScriptFunctionObject&, Object* new_target);
|
||||
GC::Ref<PrivateEnvironment> new_private_environment(VM& vm, PrivateEnvironment* outer);
|
||||
GC::Ref<Environment> get_this_environment(VM&);
|
||||
bool can_be_held_weakly(Value);
|
||||
Object* get_super_constructor(VM&);
|
||||
ThrowCompletionOr<Value> require_object_coercible(VM&, Value);
|
||||
ThrowCompletionOr<Value> call_impl(VM&, Value function, Value this_value, ReadonlySpan<Value> arguments = {});
|
||||
ThrowCompletionOr<Value> call_impl(VM&, FunctionObject& function, Value this_value, ReadonlySpan<Value> arguments = {});
|
||||
ThrowCompletionOr<GC::Ref<Object>> construct_impl(VM&, FunctionObject&, ReadonlySpan<Value> arguments = {}, FunctionObject* new_target = nullptr);
|
||||
ThrowCompletionOr<size_t> length_of_array_like(VM&, Object const&);
|
||||
JS_API ThrowCompletionOr<Value> call_impl(VM&, Value function, Value this_value, ReadonlySpan<Value> arguments = {});
|
||||
JS_API ThrowCompletionOr<Value> call_impl(VM&, FunctionObject& function, Value this_value, ReadonlySpan<Value> arguments = {});
|
||||
JS_API ThrowCompletionOr<GC::Ref<Object>> construct_impl(VM&, FunctionObject&, ReadonlySpan<Value> arguments = {}, FunctionObject* new_target = nullptr);
|
||||
JS_API ThrowCompletionOr<size_t> length_of_array_like(VM&, Object const&);
|
||||
ThrowCompletionOr<GC::RootVector<Value>> create_list_from_array_like(VM&, Value, Function<ThrowCompletionOr<void>(Value)> = {});
|
||||
ThrowCompletionOr<FunctionObject*> species_constructor(VM&, Object const&, FunctionObject& default_constructor);
|
||||
ThrowCompletionOr<Realm*> get_function_realm(VM&, FunctionObject const&);
|
||||
JS_API ThrowCompletionOr<Realm*> get_function_realm(VM&, FunctionObject const&);
|
||||
ThrowCompletionOr<void> initialize_bound_name(VM&, FlyString const&, Value, Environment*);
|
||||
bool is_compatible_property_descriptor(bool extensible, PropertyDescriptor const&, Optional<PropertyDescriptor> const& current);
|
||||
bool validate_and_apply_property_descriptor(Object*, PropertyKey const&, bool extensible, PropertyDescriptor const&, Optional<PropertyDescriptor> const& current);
|
||||
ThrowCompletionOr<Object*> get_prototype_from_constructor(VM&, FunctionObject const& constructor, GC::Ref<Object> (Intrinsics::*intrinsic_default_prototype)());
|
||||
JS_API ThrowCompletionOr<Object*> get_prototype_from_constructor(VM&, FunctionObject const& constructor, GC::Ref<Object> (Intrinsics::*intrinsic_default_prototype)());
|
||||
Object* create_unmapped_arguments_object(VM&, ReadonlySpan<Value> arguments);
|
||||
Object* create_mapped_arguments_object(VM&, FunctionObject&, NonnullRefPtr<FunctionParameters const> const&, ReadonlySpan<Value> arguments, Environment&);
|
||||
|
||||
// 2.1.1 DisposeCapability Records, https://tc39.es/proposal-explicit-resource-management/#sec-disposecapability-records
|
||||
struct DisposeCapability {
|
||||
struct JS_API DisposeCapability {
|
||||
void visit_edges(GC::Cell::Visitor&) const;
|
||||
|
||||
Vector<DisposableResource> disposable_resource_stack; // [[DisposableResourceStack]]
|
||||
|
@ -61,8 +62,8 @@ struct DisposableResource {
|
|||
GC::Ptr<FunctionObject> dispose_method; // [[DisposeMethod]]
|
||||
};
|
||||
|
||||
DisposeCapability new_dispose_capability();
|
||||
ThrowCompletionOr<void> add_disposable_resource(VM&, DisposeCapability&, Value, Environment::InitializeBindingHint, GC::Ptr<FunctionObject> = {});
|
||||
JS_API DisposeCapability new_dispose_capability();
|
||||
JS_API ThrowCompletionOr<void> add_disposable_resource(VM&, DisposeCapability&, Value, Environment::InitializeBindingHint, GC::Ptr<FunctionObject> = {});
|
||||
ThrowCompletionOr<DisposableResource> create_disposable_resource(VM&, Value, Environment::InitializeBindingHint, GC::Ptr<FunctionObject> = {});
|
||||
ThrowCompletionOr<GC::Ptr<FunctionObject>> get_dispose_method(VM&, Value, Environment::InitializeBindingHint);
|
||||
Completion dispose(VM&, Value, Environment::InitializeBindingHint, GC::Ptr<FunctionObject> method);
|
||||
|
|
|
@ -9,12 +9,13 @@
|
|||
|
||||
#include <LibGC/Function.h>
|
||||
#include <LibGC/Root.h>
|
||||
#include <LibJS/Export.h>
|
||||
#include <LibJS/Forward.h>
|
||||
|
||||
namespace JS {
|
||||
|
||||
// https://tc39.es/ecma262/#sec-agents
|
||||
class Agent {
|
||||
class JS_API Agent {
|
||||
public:
|
||||
enum class CanBlock {
|
||||
Yes,
|
||||
|
|
|
@ -12,6 +12,7 @@
|
|||
#include <AK/Function.h>
|
||||
#include <AK/Span.h>
|
||||
#include <AK/Vector.h>
|
||||
#include <LibJS/Export.h>
|
||||
#include <LibJS/Runtime/Completion.h>
|
||||
#include <LibJS/Runtime/GlobalObject.h>
|
||||
#include <LibJS/Runtime/Object.h>
|
||||
|
@ -19,7 +20,7 @@
|
|||
|
||||
namespace JS {
|
||||
|
||||
class Array : public Object {
|
||||
class JS_API Array : public Object {
|
||||
JS_OBJECT(Array, Object);
|
||||
GC_DECLARE_ALLOCATOR(Array);
|
||||
|
||||
|
|
|
@ -9,6 +9,7 @@
|
|||
#include <AK/ByteBuffer.h>
|
||||
#include <AK/Function.h>
|
||||
#include <AK/Variant.h>
|
||||
#include <LibJS/Export.h>
|
||||
#include <LibJS/Runtime/BigInt.h>
|
||||
#include <LibJS/Runtime/Completion.h>
|
||||
#include <LibJS/Runtime/GlobalObject.h>
|
||||
|
@ -54,7 +55,7 @@ struct DataBlock {
|
|||
Shared is_shared = { Shared::No };
|
||||
};
|
||||
|
||||
class ArrayBuffer : public Object {
|
||||
class JS_API ArrayBuffer : public Object {
|
||||
JS_OBJECT(ArrayBuffer, Object);
|
||||
GC_DECLARE_ALLOCATOR(ArrayBuffer);
|
||||
|
||||
|
@ -145,14 +146,14 @@ private:
|
|||
Value m_detach_key;
|
||||
};
|
||||
|
||||
ThrowCompletionOr<DataBlock> create_byte_data_block(VM& vm, size_t size);
|
||||
void copy_data_block_bytes(ByteBuffer& to_block, u64 to_index, ByteBuffer const& from_block, u64 from_index, u64 count);
|
||||
JS_API ThrowCompletionOr<DataBlock> create_byte_data_block(VM& vm, size_t size);
|
||||
JS_API void copy_data_block_bytes(ByteBuffer& to_block, u64 to_index, ByteBuffer const& from_block, u64 from_index, u64 count);
|
||||
ThrowCompletionOr<ArrayBuffer*> allocate_array_buffer(VM&, FunctionObject& constructor, size_t byte_length, Optional<size_t> const& max_byte_length = {});
|
||||
ThrowCompletionOr<ArrayBuffer*> array_buffer_copy_and_detach(VM&, ArrayBuffer& array_buffer, Value new_length, PreserveResizability preserve_resizability);
|
||||
ThrowCompletionOr<void> detach_array_buffer(VM&, ArrayBuffer& array_buffer, Optional<Value> key = {});
|
||||
JS_API ThrowCompletionOr<void> detach_array_buffer(VM&, ArrayBuffer& array_buffer, Optional<Value> key = {});
|
||||
ThrowCompletionOr<Optional<size_t>> get_array_buffer_max_byte_length_option(VM&, Value options);
|
||||
ThrowCompletionOr<ArrayBuffer*> clone_array_buffer(VM&, ArrayBuffer& source_buffer, size_t source_byte_offset, size_t source_length);
|
||||
ThrowCompletionOr<GC::Ref<ArrayBuffer>> allocate_shared_array_buffer(VM&, FunctionObject& constructor, size_t byte_length);
|
||||
JS_API ThrowCompletionOr<ArrayBuffer*> clone_array_buffer(VM&, ArrayBuffer& source_buffer, size_t source_byte_offset, size_t source_length);
|
||||
JS_API ThrowCompletionOr<GC::Ref<ArrayBuffer>> allocate_shared_array_buffer(VM&, FunctionObject& constructor, size_t byte_length);
|
||||
|
||||
// 25.1.3.2 ArrayBufferByteLength ( arrayBuffer, order ), https://tc39.es/ecma262/#sec-arraybufferbytelength
|
||||
inline size_t array_buffer_byte_length(ArrayBuffer const& array_buffer, ArrayBuffer::Order)
|
||||
|
|
|
@ -11,11 +11,12 @@
|
|||
#include <AK/StringView.h>
|
||||
#include <LibCrypto/BigInt/SignedBigInteger.h>
|
||||
#include <LibGC/CellAllocator.h>
|
||||
#include <LibJS/Export.h>
|
||||
#include <LibJS/Heap/Cell.h>
|
||||
|
||||
namespace JS {
|
||||
|
||||
class BigInt final : public Cell {
|
||||
class JS_API BigInt final : public Cell {
|
||||
GC_CELL(BigInt, Cell);
|
||||
GC_DECLARE_ALLOCATOR(BigInt);
|
||||
|
||||
|
|
|
@ -6,12 +6,13 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include <LibJS/Export.h>
|
||||
#include <LibJS/Runtime/BigInt.h>
|
||||
#include <LibJS/Runtime/Object.h>
|
||||
|
||||
namespace JS {
|
||||
|
||||
class BigIntObject final : public Object {
|
||||
class JS_API BigIntObject final : public Object {
|
||||
JS_OBJECT(BigIntObject, Object);
|
||||
GC_DECLARE_ALLOCATOR(BigIntObject);
|
||||
|
||||
|
|
|
@ -6,11 +6,12 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include <LibJS/Export.h>
|
||||
#include <LibJS/Runtime/Object.h>
|
||||
|
||||
namespace JS {
|
||||
|
||||
class BooleanObject : public Object {
|
||||
class JS_API BooleanObject : public Object {
|
||||
JS_OBJECT(BooleanObject, Object);
|
||||
GC_DECLARE_ALLOCATOR(BooleanObject);
|
||||
|
||||
|
|
|
@ -11,6 +11,7 @@
|
|||
#include <AK/Try.h>
|
||||
#include <AK/TypeCasts.h>
|
||||
#include <AK/Variant.h>
|
||||
#include <LibJS/Export.h>
|
||||
#include <LibJS/Runtime/ErrorTypes.h>
|
||||
#include <LibJS/Runtime/Value.h>
|
||||
|
||||
|
@ -49,7 +50,7 @@ namespace JS {
|
|||
})
|
||||
|
||||
// 6.2.3 The Completion Record Specification Type, https://tc39.es/ecma262/#sec-completion-record-specification-type
|
||||
class [[nodiscard]] Completion {
|
||||
class [[nodiscard]] JS_API Completion {
|
||||
public:
|
||||
enum class Type {
|
||||
Empty,
|
||||
|
@ -345,6 +346,6 @@ inline Completion normal_completion(Value value)
|
|||
}
|
||||
|
||||
// 6.2.4.2 ThrowCompletion ( value ), https://tc39.es/ecma262/#sec-throwcompletion
|
||||
Completion throw_completion(Value);
|
||||
JS_API Completion throw_completion(Value);
|
||||
|
||||
}
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include <LibJS/Export.h>
|
||||
#include <LibJS/Runtime/ArrayBuffer.h>
|
||||
#include <LibJS/Runtime/ByteLength.h>
|
||||
#include <LibJS/Runtime/GlobalObject.h>
|
||||
|
@ -13,7 +14,7 @@
|
|||
|
||||
namespace JS {
|
||||
|
||||
class DataView : public Object {
|
||||
class JS_API DataView : public Object {
|
||||
JS_OBJECT(DataView, Object);
|
||||
GC_DECLARE_ALLOCATOR(DataView);
|
||||
|
||||
|
@ -42,8 +43,8 @@ struct DataViewWithBufferWitness {
|
|||
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&);
|
||||
JS_API DataViewWithBufferWitness make_data_view_with_buffer_witness_record(DataView const&, ArrayBuffer::Order);
|
||||
JS_API u32 get_view_byte_length(DataViewWithBufferWitness const&);
|
||||
JS_API bool is_view_out_of_bounds(DataViewWithBufferWitness const&);
|
||||
|
||||
}
|
||||
|
|
|
@ -8,12 +8,13 @@
|
|||
#pragma once
|
||||
|
||||
#include <LibCrypto/BigInt/SignedBigInteger.h>
|
||||
#include <LibJS/Export.h>
|
||||
#include <LibJS/Runtime/Object.h>
|
||||
#include <LibUnicode/TimeZone.h>
|
||||
|
||||
namespace JS {
|
||||
|
||||
class Date final : public Object {
|
||||
class JS_API Date final : public Object {
|
||||
JS_OBJECT(Date, Object);
|
||||
GC_DECLARE_ALLOCATOR(Date);
|
||||
|
||||
|
@ -68,27 +69,27 @@ double time_within_day(double);
|
|||
u16 days_in_year(i32);
|
||||
double day_from_year(i32);
|
||||
double time_from_year(i32);
|
||||
i32 year_from_time(double);
|
||||
JS_API i32 year_from_time(double);
|
||||
u16 day_within_year(double);
|
||||
bool in_leap_year(double);
|
||||
u8 month_from_time(double);
|
||||
u8 date_from_time(double);
|
||||
JS_API u8 month_from_time(double);
|
||||
JS_API u8 date_from_time(double);
|
||||
u8 week_day(double);
|
||||
u8 hour_from_time(double);
|
||||
u8 min_from_time(double);
|
||||
u8 sec_from_time(double);
|
||||
u16 ms_from_time(double);
|
||||
JS_API u8 hour_from_time(double);
|
||||
JS_API u8 min_from_time(double);
|
||||
JS_API u8 sec_from_time(double);
|
||||
JS_API u16 ms_from_time(double);
|
||||
Crypto::SignedBigInteger get_utc_epoch_nanoseconds(Temporal::ISODateTime const&);
|
||||
Vector<Crypto::SignedBigInteger> get_named_time_zone_epoch_nanoseconds(StringView time_zone_identifier, Temporal::ISODateTime const&);
|
||||
Unicode::TimeZoneOffset get_named_time_zone_offset_nanoseconds(StringView time_zone_identifier, Crypto::SignedBigInteger const& epoch_nanoseconds);
|
||||
Unicode::TimeZoneOffset get_named_time_zone_offset_milliseconds(StringView time_zone_identifier, double epoch_milliseconds);
|
||||
String system_time_zone_identifier();
|
||||
void clear_system_time_zone_cache();
|
||||
JS_API void clear_system_time_zone_cache();
|
||||
double local_time(double time);
|
||||
double utc_time(double time);
|
||||
double make_time(double hour, double min, double sec, double ms);
|
||||
double make_day(double year, double month, double date);
|
||||
double make_date(double day, double time);
|
||||
JS_API double make_time(double hour, double min, double sec, double ms);
|
||||
JS_API double make_day(double year, double month, double date);
|
||||
JS_API double make_date(double day, double time);
|
||||
double time_clip(double time);
|
||||
bool is_offset_time_zone_identifier(StringView offset_string);
|
||||
ThrowCompletionOr<double> parse_date_time_utc_offset(VM&, StringView offset_string);
|
||||
|
|
|
@ -10,6 +10,7 @@
|
|||
|
||||
#include <LibJS/Bytecode/Generator.h>
|
||||
#include <LibJS/Bytecode/Interpreter.h>
|
||||
#include <LibJS/Export.h>
|
||||
#include <LibJS/Runtime/ClassFieldDefinition.h>
|
||||
#include <LibJS/Runtime/ExecutionContext.h>
|
||||
#include <LibJS/Runtime/FunctionObject.h>
|
||||
|
@ -98,7 +99,7 @@ public:
|
|||
};
|
||||
|
||||
// 10.2 ECMAScript Function Objects, https://tc39.es/ecma262/#sec-ecmascript-function-objects
|
||||
class ECMAScriptFunctionObject final : public FunctionObject {
|
||||
class JS_API ECMAScriptFunctionObject final : public FunctionObject {
|
||||
JS_OBJECT(ECMAScriptFunctionObject, FunctionObject);
|
||||
GC_DECLARE_ALLOCATOR(ECMAScriptFunctionObject);
|
||||
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
#pragma once
|
||||
|
||||
#include <AK/StringView.h>
|
||||
#include <LibJS/Export.h>
|
||||
#include <LibJS/Runtime/Completion.h>
|
||||
#include <LibJS/Runtime/Object.h>
|
||||
|
||||
|
@ -19,7 +20,7 @@ struct Variable {
|
|||
|
||||
#define JS_ENVIRONMENT(class_, base_class) GC_CELL(class_, base_class)
|
||||
|
||||
class Environment : public Cell {
|
||||
class JS_API Environment : public Cell {
|
||||
GC_CELL(Environment, Cell);
|
||||
|
||||
public:
|
||||
|
|
|
@ -8,13 +8,14 @@
|
|||
#pragma once
|
||||
|
||||
#include <AK/String.h>
|
||||
#include <LibJS/Export.h>
|
||||
#include <LibJS/Runtime/Completion.h>
|
||||
#include <LibJS/Runtime/Object.h>
|
||||
#include <LibJS/SourceRange.h>
|
||||
|
||||
namespace JS {
|
||||
|
||||
struct TracebackFrame {
|
||||
struct JS_API TracebackFrame {
|
||||
FlyString function_name;
|
||||
[[nodiscard]] SourceRange const& source_range() const;
|
||||
|
||||
|
@ -26,7 +27,7 @@ enum CompactTraceback {
|
|||
Yes,
|
||||
};
|
||||
|
||||
class Error : public Object {
|
||||
class JS_API Error : public Object {
|
||||
JS_OBJECT(Error, Object);
|
||||
GC_DECLARE_ALLOCATOR(Error);
|
||||
|
||||
|
@ -62,7 +63,7 @@ inline bool Object::fast_is<Error>() const { return is_error_object(); }
|
|||
// our way of implementing the [[ErrorData]] internal slot, which is
|
||||
// used in Object.prototype.toString().
|
||||
#define DECLARE_NATIVE_ERROR(ClassName, snake_name, PrototypeName, ConstructorName) \
|
||||
class ClassName final : public Error { \
|
||||
class JS_API ClassName final : public Error { \
|
||||
JS_OBJECT(ClassName, Error); \
|
||||
GC_DECLARE_ALLOCATOR(ClassName); \
|
||||
\
|
||||
|
|
|
@ -11,6 +11,7 @@
|
|||
|
||||
#include <AK/WeakPtr.h>
|
||||
#include <LibJS/Bytecode/BasicBlock.h>
|
||||
#include <LibJS/Export.h>
|
||||
#include <LibJS/Forward.h>
|
||||
#include <LibJS/Module.h>
|
||||
#include <LibJS/Runtime/PrivateEnvironment.h>
|
||||
|
@ -32,7 +33,7 @@ struct CachedSourceRange : public RefCounted<CachedSourceRange> {
|
|||
};
|
||||
|
||||
// 9.4 Execution Contexts, https://tc39.es/ecma262/#sec-execution-contexts
|
||||
struct ExecutionContext {
|
||||
struct JS_API ExecutionContext {
|
||||
static NonnullOwnPtr<ExecutionContext> create(u32 registers_and_constants_and_locals_count, u32 arguments_count);
|
||||
[[nodiscard]] NonnullOwnPtr<ExecutionContext> copy() const;
|
||||
|
||||
|
|
|
@ -9,6 +9,7 @@
|
|||
#include <AK/SinglyLinkedList.h>
|
||||
#include <LibGC/Ptr.h>
|
||||
#include <LibGC/WeakContainer.h>
|
||||
#include <LibJS/Export.h>
|
||||
#include <LibJS/Runtime/FunctionObject.h>
|
||||
#include <LibJS/Runtime/GlobalObject.h>
|
||||
#include <LibJS/Runtime/JobCallback.h>
|
||||
|
@ -17,7 +18,7 @@
|
|||
|
||||
namespace JS {
|
||||
|
||||
class FinalizationRegistry final
|
||||
class JS_API FinalizationRegistry final
|
||||
: public Object
|
||||
, public GC::WeakContainer {
|
||||
JS_OBJECT(FinalizationRegistry, Object);
|
||||
|
|
|
@ -6,11 +6,12 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include <LibJS/Export.h>
|
||||
#include <LibJS/Runtime/Environment.h>
|
||||
|
||||
namespace JS {
|
||||
|
||||
class GlobalEnvironment final : public Environment {
|
||||
class JS_API GlobalEnvironment final : public Environment {
|
||||
JS_ENVIRONMENT(GlobalEnvironment, Environment);
|
||||
GC_DECLARE_ALLOCATOR(GlobalEnvironment);
|
||||
|
||||
|
|
|
@ -8,12 +8,13 @@
|
|||
#pragma once
|
||||
|
||||
#include <LibGC/Heap.h>
|
||||
#include <LibJS/Export.h>
|
||||
#include <LibJS/Runtime/Environment.h>
|
||||
#include <LibJS/Runtime/VM.h>
|
||||
|
||||
namespace JS {
|
||||
|
||||
class GlobalObject : public Object {
|
||||
class JS_API GlobalObject : public Object {
|
||||
JS_OBJECT(GlobalObject, Object);
|
||||
GC_DECLARE_ALLOCATOR(GlobalObject);
|
||||
|
||||
|
@ -43,7 +44,7 @@ private:
|
|||
JS_DECLARE_NATIVE_FUNCTION(unescape);
|
||||
};
|
||||
|
||||
void set_default_global_bindings(Realm&);
|
||||
JS_API void set_default_global_bindings(Realm&);
|
||||
|
||||
template<>
|
||||
inline bool Object::fast_is<GlobalObject>() const { return is_global_object(); }
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
#pragma once
|
||||
|
||||
#include <AK/NonnullOwnPtr.h>
|
||||
#include <LibJS/Export.h>
|
||||
#include <LibJS/Runtime/Shape.h>
|
||||
#include <LibJS/Runtime/Value.h>
|
||||
|
||||
|
@ -128,7 +129,7 @@ private:
|
|||
HashMap<u32, ValueAndAttributes> m_sparse_elements;
|
||||
};
|
||||
|
||||
class IndexedPropertyIterator {
|
||||
class JS_API IndexedPropertyIterator {
|
||||
public:
|
||||
IndexedPropertyIterator(IndexedProperties const&, u32 starting_index, bool skip_empty);
|
||||
|
||||
|
@ -148,7 +149,7 @@ private:
|
|||
bool m_skip_empty { false };
|
||||
};
|
||||
|
||||
class IndexedProperties {
|
||||
class JS_API IndexedProperties {
|
||||
public:
|
||||
IndexedProperties() = default;
|
||||
|
||||
|
|
|
@ -9,6 +9,7 @@
|
|||
#include <AK/String.h>
|
||||
#include <AK/Variant.h>
|
||||
#include <LibCrypto/BigInt/SignedBigInteger.h>
|
||||
#include <LibJS/Export.h>
|
||||
#include <LibJS/Runtime/BigInt.h>
|
||||
#include <LibJS/Runtime/Value.h>
|
||||
#include <LibUnicode/NumberFormat.h>
|
||||
|
@ -16,7 +17,7 @@
|
|||
namespace JS::Intl {
|
||||
|
||||
// https://tc39.es/ecma402/#intl-mathematical-value
|
||||
class MathematicalValue {
|
||||
class JS_API MathematicalValue {
|
||||
public:
|
||||
enum class Symbol {
|
||||
PositiveInfinity,
|
||||
|
|
|
@ -8,6 +8,7 @@
|
|||
|
||||
#include <AK/Optional.h>
|
||||
#include <AK/String.h>
|
||||
#include <LibJS/Export.h>
|
||||
#include <LibJS/Runtime/Intl/AbstractOperations.h>
|
||||
#include <LibJS/Runtime/Intl/IntlObject.h>
|
||||
#include <LibJS/Runtime/Intl/MathematicalValue.h>
|
||||
|
|
|
@ -8,12 +8,13 @@
|
|||
#pragma once
|
||||
|
||||
#include <LibGC/CellAllocator.h>
|
||||
#include <LibJS/Export.h>
|
||||
#include <LibJS/Forward.h>
|
||||
#include <LibJS/Heap/Cell.h>
|
||||
|
||||
namespace JS {
|
||||
|
||||
class Intrinsics final : public Cell {
|
||||
class JS_API Intrinsics final : public Cell {
|
||||
GC_CELL(Intrinsics, Cell);
|
||||
GC_DECLARE_ALLOCATOR(Intrinsics);
|
||||
|
||||
|
|
|
@ -10,6 +10,7 @@
|
|||
|
||||
#include <AK/Function.h>
|
||||
#include <AK/Optional.h>
|
||||
#include <LibJS/Export.h>
|
||||
#include <LibJS/Runtime/Completion.h>
|
||||
#include <LibJS/Runtime/Object.h>
|
||||
#include <LibJS/Runtime/Value.h>
|
||||
|
@ -102,18 +103,18 @@ using IterationResultOrDone = Variant<IterationResult, IterationDone>;
|
|||
})
|
||||
|
||||
ThrowCompletionOr<GC::Ref<IteratorRecord>> get_iterator_direct(VM&, Object&);
|
||||
ThrowCompletionOr<GC::Ref<IteratorRecord>> get_iterator_from_method(VM&, Value, GC::Ref<FunctionObject>);
|
||||
ThrowCompletionOr<GC::Ref<IteratorRecord>> get_iterator(VM&, Value, IteratorHint);
|
||||
JS_API ThrowCompletionOr<GC::Ref<IteratorRecord>> get_iterator_from_method(VM&, Value, GC::Ref<FunctionObject>);
|
||||
JS_API ThrowCompletionOr<GC::Ref<IteratorRecord>> get_iterator(VM&, Value, IteratorHint);
|
||||
ThrowCompletionOr<GC::Ref<IteratorRecord>> get_iterator_flattenable(VM&, Value, PrimitiveHandling);
|
||||
ThrowCompletionOr<GC::Ref<Object>> iterator_next(VM&, IteratorRecord&, Optional<Value> = {});
|
||||
ThrowCompletionOr<bool> iterator_complete(VM&, Object& iterator_result);
|
||||
ThrowCompletionOr<Value> iterator_value(VM&, Object& iterator_result);
|
||||
ThrowCompletionOr<IterationResultOrDone> iterator_step(VM&, IteratorRecord&);
|
||||
ThrowCompletionOr<Optional<Value>> iterator_step_value(VM&, IteratorRecord&);
|
||||
JS_API ThrowCompletionOr<GC::Ref<Object>> iterator_next(VM&, IteratorRecord&, Optional<Value> = {});
|
||||
JS_API ThrowCompletionOr<bool> iterator_complete(VM&, Object& iterator_result);
|
||||
JS_API ThrowCompletionOr<Value> iterator_value(VM&, Object& iterator_result);
|
||||
JS_API ThrowCompletionOr<IterationResultOrDone> iterator_step(VM&, IteratorRecord&);
|
||||
JS_API ThrowCompletionOr<Optional<Value>> iterator_step_value(VM&, IteratorRecord&);
|
||||
Completion iterator_close(VM&, IteratorRecord const&, Completion);
|
||||
Completion async_iterator_close(VM&, IteratorRecord const&, Completion);
|
||||
GC::Ref<Object> create_iterator_result_object(VM&, Value, bool done);
|
||||
ThrowCompletionOr<GC::RootVector<Value>> iterator_to_list(VM&, IteratorRecord&);
|
||||
JS_API GC::Ref<Object> create_iterator_result_object(VM&, Value, bool done);
|
||||
JS_API ThrowCompletionOr<GC::RootVector<Value>> iterator_to_list(VM&, IteratorRecord&);
|
||||
ThrowCompletionOr<void> setter_that_ignores_prototype_properties(VM&, Value this_, Object const& home, PropertyKey const& property, Value value);
|
||||
|
||||
using IteratorValueCallback = Function<Optional<Completion>(Value)>;
|
||||
|
|
|
@ -6,11 +6,12 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include <LibJS/Export.h>
|
||||
#include <LibJS/Runtime/Object.h>
|
||||
|
||||
namespace JS {
|
||||
|
||||
class JSONObject final : public Object {
|
||||
class JS_API JSONObject final : public Object {
|
||||
JS_OBJECT(JSONObject, Object);
|
||||
GC_DECLARE_ALLOCATOR(JSONObject);
|
||||
|
||||
|
|
|
@ -8,6 +8,7 @@
|
|||
|
||||
#include <AK/OwnPtr.h>
|
||||
#include <LibGC/Root.h>
|
||||
#include <LibJS/Export.h>
|
||||
#include <LibJS/Runtime/Completion.h>
|
||||
#include <LibJS/Runtime/FunctionObject.h>
|
||||
#include <LibJS/Runtime/VM.h>
|
||||
|
@ -15,7 +16,7 @@
|
|||
namespace JS {
|
||||
|
||||
// 9.5.1 JobCallback Records, https://tc39.es/ecma262/#sec-jobcallback-records
|
||||
class JobCallback : public JS::Cell {
|
||||
class JS_API JobCallback : public JS::Cell {
|
||||
GC_CELL(JobCallback, JS::Cell);
|
||||
GC_DECLARE_ALLOCATOR(JobCallback);
|
||||
|
||||
|
|
|
@ -8,6 +8,7 @@
|
|||
|
||||
#include <AK/HashMap.h>
|
||||
#include <AK/RedBlackTree.h>
|
||||
#include <LibJS/Export.h>
|
||||
#include <LibJS/Runtime/GlobalObject.h>
|
||||
#include <LibJS/Runtime/Object.h>
|
||||
#include <LibJS/Runtime/Value.h>
|
||||
|
@ -15,7 +16,7 @@
|
|||
|
||||
namespace JS {
|
||||
|
||||
class Map : public Object {
|
||||
class JS_API Map : public Object {
|
||||
JS_OBJECT(Map, Object);
|
||||
GC_DECLARE_ALLOCATOR(Map);
|
||||
|
||||
|
|
|
@ -11,13 +11,14 @@
|
|||
#include <AK/Optional.h>
|
||||
#include <LibGC/Function.h>
|
||||
#include <LibJS/Bytecode/Builtins.h>
|
||||
#include <LibJS/Export.h>
|
||||
#include <LibJS/Runtime/Completion.h>
|
||||
#include <LibJS/Runtime/FunctionObject.h>
|
||||
#include <LibJS/Runtime/PropertyKey.h>
|
||||
|
||||
namespace JS {
|
||||
|
||||
class NativeFunction : public FunctionObject {
|
||||
class JS_API NativeFunction : public FunctionObject {
|
||||
JS_OBJECT(NativeFunction, FunctionObject);
|
||||
GC_DECLARE_ALLOCATOR(NativeFunction);
|
||||
|
||||
|
|
|
@ -6,11 +6,12 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include <LibJS/Export.h>
|
||||
#include <LibJS/Runtime/Object.h>
|
||||
|
||||
namespace JS {
|
||||
|
||||
class NumberObject : public Object {
|
||||
class JS_API NumberObject : public Object {
|
||||
JS_OBJECT(NumberObject, Object);
|
||||
GC_DECLARE_ALLOCATOR(NumberObject);
|
||||
|
||||
|
|
|
@ -11,6 +11,7 @@
|
|||
#include <AK/StringView.h>
|
||||
#include <LibGC/CellAllocator.h>
|
||||
#include <LibGC/RootVector.h>
|
||||
#include <LibJS/Export.h>
|
||||
#include <LibJS/Forward.h>
|
||||
#include <LibJS/Heap/Cell.h>
|
||||
#include <LibJS/Runtime/Completion.h>
|
||||
|
@ -51,7 +52,7 @@ struct CacheablePropertyMetadata {
|
|||
GC::Ptr<Object const> prototype;
|
||||
};
|
||||
|
||||
class Object : public Cell
|
||||
class JS_API Object : public Cell
|
||||
, public Weakable<Object> {
|
||||
GC_CELL(Object, Cell);
|
||||
GC_DECLARE_ALLOCATOR(Object);
|
||||
|
|
|
@ -12,6 +12,7 @@
|
|||
#include <AK/StringView.h>
|
||||
#include <AK/Utf16String.h>
|
||||
#include <LibGC/CellAllocator.h>
|
||||
#include <LibJS/Export.h>
|
||||
#include <LibJS/Forward.h>
|
||||
#include <LibJS/Heap/Cell.h>
|
||||
#include <LibJS/Runtime/Completion.h>
|
||||
|
@ -19,7 +20,7 @@
|
|||
|
||||
namespace JS {
|
||||
|
||||
class PrimitiveString : public Cell {
|
||||
class JS_API PrimitiveString : public Cell {
|
||||
GC_CELL(PrimitiveString, Cell);
|
||||
GC_DECLARE_ALLOCATOR(PrimitiveString);
|
||||
|
||||
|
|
|
@ -7,13 +7,14 @@
|
|||
#pragma once
|
||||
|
||||
#include <AK/Vector.h>
|
||||
#include <LibJS/Export.h>
|
||||
#include <LibJS/Runtime/Object.h>
|
||||
|
||||
namespace JS {
|
||||
|
||||
ThrowCompletionOr<Object*> promise_resolve(VM&, Object& constructor, Value);
|
||||
|
||||
class Promise : public Object {
|
||||
class JS_API Promise : public Object {
|
||||
JS_OBJECT(Promise, Object);
|
||||
GC_DECLARE_ALLOCATOR(Promise);
|
||||
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
#pragma once
|
||||
|
||||
#include <AK/Forward.h>
|
||||
#include <LibJS/Export.h>
|
||||
#include <LibJS/Forward.h>
|
||||
#include <LibJS/Runtime/AbstractOperations.h>
|
||||
|
||||
|
@ -65,6 +66,6 @@ private:
|
|||
__TRY_OR_REJECT(vm, capability, expression, MUST)
|
||||
|
||||
// 27.2.1.5 NewPromiseCapability ( C ), https://tc39.es/ecma262/#sec-newpromisecapability
|
||||
ThrowCompletionOr<GC::Ref<PromiseCapability>> new_promise_capability(VM& vm, Value constructor);
|
||||
JS_API ThrowCompletionOr<GC::Ref<PromiseCapability>> new_promise_capability(VM& vm, Value constructor);
|
||||
|
||||
}
|
||||
|
|
|
@ -8,6 +8,7 @@
|
|||
|
||||
#include <AK/Optional.h>
|
||||
#include <AK/String.h>
|
||||
#include <LibJS/Export.h>
|
||||
#include <LibJS/Forward.h>
|
||||
#include <LibJS/Runtime/Value.h>
|
||||
|
||||
|
@ -18,7 +19,7 @@ namespace JS {
|
|||
Value from_property_descriptor(VM&, Optional<PropertyDescriptor> const&);
|
||||
ThrowCompletionOr<PropertyDescriptor> to_property_descriptor(VM&, Value);
|
||||
|
||||
class PropertyDescriptor {
|
||||
class JS_API PropertyDescriptor {
|
||||
public:
|
||||
[[nodiscard]] bool is_accessor_descriptor() const;
|
||||
[[nodiscard]] bool is_data_descriptor() const;
|
||||
|
|
|
@ -14,6 +14,7 @@
|
|||
#include <LibGC/CellAllocator.h>
|
||||
#include <LibGC/Heap.h>
|
||||
#include <LibJS/Bytecode/Builtins.h>
|
||||
#include <LibJS/Export.h>
|
||||
#include <LibJS/Heap/Cell.h>
|
||||
#include <LibJS/Runtime/Intrinsics.h>
|
||||
#include <LibJS/Runtime/Value.h>
|
||||
|
@ -21,7 +22,7 @@
|
|||
namespace JS {
|
||||
|
||||
// 9.3 Realms, https://tc39.es/ecma262/#realm-record
|
||||
class Realm final : public Cell {
|
||||
class JS_API Realm final : public Cell {
|
||||
GC_CELL(Realm, Cell);
|
||||
GC_DECLARE_ALLOCATOR(Realm);
|
||||
|
||||
|
|
|
@ -10,12 +10,13 @@
|
|||
#include <AK/EnumBits.h>
|
||||
#include <AK/Optional.h>
|
||||
#include <AK/Result.h>
|
||||
#include <LibJS/Export.h>
|
||||
#include <LibJS/Runtime/Object.h>
|
||||
#include <LibRegex/Regex.h>
|
||||
|
||||
namespace JS {
|
||||
|
||||
ThrowCompletionOr<GC::Ref<RegExpObject>> regexp_create(VM&, Value pattern, Value flags);
|
||||
JS_API ThrowCompletionOr<GC::Ref<RegExpObject>> regexp_create(VM&, Value pattern, Value flags);
|
||||
ThrowCompletionOr<GC::Ref<RegExpObject>> regexp_alloc(VM&, FunctionObject& new_target);
|
||||
|
||||
Result<regex::RegexOptions<ECMAScriptFlags>, String> regex_flags_from_string(StringView flags);
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include <LibJS/Export.h>
|
||||
#include <LibJS/Runtime/GlobalObject.h>
|
||||
#include <LibJS/Runtime/Map.h>
|
||||
#include <LibJS/Runtime/Object.h>
|
||||
|
@ -13,7 +14,7 @@
|
|||
|
||||
namespace JS {
|
||||
|
||||
class Set : public Object {
|
||||
class JS_API Set : public Object {
|
||||
JS_OBJECT(Set, Object);
|
||||
GC_DECLARE_ALLOCATOR(Set);
|
||||
|
||||
|
|
|
@ -6,13 +6,14 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include <LibJS/Export.h>
|
||||
#include <LibJS/Runtime/Iterator.h>
|
||||
#include <LibJS/Runtime/Object.h>
|
||||
#include <LibJS/Runtime/Set.h>
|
||||
|
||||
namespace JS {
|
||||
|
||||
class SetIterator final : public Object
|
||||
class JS_API SetIterator final : public Object
|
||||
, public BuiltinIterator {
|
||||
JS_OBJECT(SetIterator, Object);
|
||||
GC_DECLARE_ALLOCATOR(SetIterator);
|
||||
|
|
|
@ -11,6 +11,7 @@
|
|||
#include <AK/StringView.h>
|
||||
#include <AK/WeakPtr.h>
|
||||
#include <AK/Weakable.h>
|
||||
#include <LibJS/Export.h>
|
||||
#include <LibJS/Forward.h>
|
||||
#include <LibJS/Heap/Cell.h>
|
||||
#include <LibJS/Runtime/PropertyAttributes.h>
|
||||
|
@ -48,7 +49,7 @@ private:
|
|||
size_t padding { 0 };
|
||||
};
|
||||
|
||||
class Shape final : public Cell
|
||||
class JS_API Shape final : public Cell
|
||||
, public Weakable<Shape> {
|
||||
GC_CELL(Shape, Cell);
|
||||
GC_DECLARE_ALLOCATOR(Shape);
|
||||
|
|
|
@ -6,11 +6,12 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include <LibJS/Export.h>
|
||||
#include <LibJS/Runtime/Object.h>
|
||||
|
||||
namespace JS {
|
||||
|
||||
class StringObject : public Object {
|
||||
class JS_API StringObject : public Object {
|
||||
JS_OBJECT(StringObject, Object);
|
||||
GC_DECLARE_ALLOCATOR(StringObject);
|
||||
|
||||
|
|
|
@ -9,11 +9,12 @@
|
|||
|
||||
#include <AK/String.h>
|
||||
#include <LibGC/CellAllocator.h>
|
||||
#include <LibJS/Export.h>
|
||||
#include <LibJS/Heap/Cell.h>
|
||||
|
||||
namespace JS {
|
||||
|
||||
class Symbol final : public Cell {
|
||||
class JS_API Symbol final : public Cell {
|
||||
GC_CELL(Symbol, Cell);
|
||||
GC_DECLARE_ALLOCATOR(Symbol);
|
||||
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include <LibJS/Export.h>
|
||||
#include <LibJS/Runtime/AbstractOperations.h>
|
||||
#include <LibJS/Runtime/ArrayBuffer.h>
|
||||
#include <LibJS/Runtime/ByteLength.h>
|
||||
|
@ -91,10 +92,10 @@ struct TypedArrayWithBufferWitness {
|
|||
ByteLength cached_buffer_byte_length; // [[CachedBufferByteLength]]
|
||||
};
|
||||
|
||||
TypedArrayWithBufferWitness make_typed_array_with_buffer_witness_record(TypedArrayBase const&, ArrayBuffer::Order);
|
||||
u32 typed_array_byte_length(TypedArrayWithBufferWitness const&);
|
||||
u32 typed_array_length(TypedArrayWithBufferWitness const&);
|
||||
bool is_typed_array_out_of_bounds(TypedArrayWithBufferWitness const&);
|
||||
JS_API TypedArrayWithBufferWitness make_typed_array_with_buffer_witness_record(TypedArrayBase const&, ArrayBuffer::Order);
|
||||
JS_API u32 typed_array_byte_length(TypedArrayWithBufferWitness const&);
|
||||
JS_API u32 typed_array_length(TypedArrayWithBufferWitness const&);
|
||||
JS_API bool is_typed_array_out_of_bounds(TypedArrayWithBufferWitness const&);
|
||||
bool is_typed_array_fixed_length(TypedArrayBase const&);
|
||||
bool is_valid_integer_index_slow_case(TypedArrayBase const&, CanonicalIndex property_index);
|
||||
|
||||
|
@ -507,14 +508,14 @@ protected:
|
|||
}
|
||||
};
|
||||
|
||||
ThrowCompletionOr<TypedArrayBase*> typed_array_from(VM&, Value);
|
||||
JS_API ThrowCompletionOr<TypedArrayBase*> typed_array_from(VM&, Value);
|
||||
ThrowCompletionOr<TypedArrayBase*> typed_array_create(VM&, FunctionObject& constructor, GC::RootVector<Value> arguments);
|
||||
ThrowCompletionOr<TypedArrayBase*> typed_array_create_same_type(VM&, TypedArrayBase const& exemplar, GC::RootVector<Value> arguments);
|
||||
ThrowCompletionOr<TypedArrayWithBufferWitness> validate_typed_array(VM&, Object const&, ArrayBuffer::Order);
|
||||
ThrowCompletionOr<double> compare_typed_array_elements(VM&, Value x, Value y, FunctionObject* comparefn);
|
||||
|
||||
#define JS_DECLARE_TYPED_ARRAY(ClassName, snake_name, PrototypeName, ConstructorName, Type) \
|
||||
class ClassName : public TypedArray<Type> { \
|
||||
class JS_API ClassName : public TypedArray<Type> { \
|
||||
JS_OBJECT(ClassName, TypedArray); \
|
||||
GC_DECLARE_ALLOCATOR(ClassName); \
|
||||
\
|
||||
|
|
|
@ -20,6 +20,7 @@
|
|||
#include <LibGC/Heap.h>
|
||||
#include <LibGC/RootVector.h>
|
||||
#include <LibJS/CyclicModule.h>
|
||||
#include <LibJS/Export.h>
|
||||
#include <LibJS/ModuleLoading.h>
|
||||
#include <LibJS/Runtime/Agent.h>
|
||||
#include <LibJS/Runtime/CommonPropertyNames.h>
|
||||
|
@ -52,7 +53,7 @@ enum class CompilationType {
|
|||
Timer,
|
||||
};
|
||||
|
||||
class VM : public RefCounted<VM> {
|
||||
class JS_API VM : public RefCounted<VM> {
|
||||
public:
|
||||
static NonnullRefPtr<VM> create();
|
||||
~VM();
|
||||
|
|
|
@ -21,6 +21,7 @@
|
|||
#include <LibGC/NanBoxedValue.h>
|
||||
#include <LibGC/Ptr.h>
|
||||
#include <LibGC/Root.h>
|
||||
#include <LibJS/Export.h>
|
||||
#include <LibJS/Forward.h>
|
||||
#include <LibJS/Heap/Cell.h>
|
||||
#include <math.h>
|
||||
|
@ -85,7 +86,7 @@ static constexpr u64 SHIFTED_INT32_TAG = INT32_TAG << GC::TAG_SHIFT;
|
|||
// options from 8 tags to 15 but since we currently only use 5 for both sign bits
|
||||
// this is not needed.
|
||||
|
||||
class Value : public GC::NanBoxedValue {
|
||||
class JS_API Value : public GC::NanBoxedValue {
|
||||
public:
|
||||
enum class PreferredType {
|
||||
Default,
|
||||
|
@ -524,8 +525,8 @@ ThrowCompletionOr<Value> ordinary_has_instance(VM&, Value lhs, Value rhs);
|
|||
|
||||
ThrowCompletionOr<bool> is_loosely_equal(VM&, Value lhs, Value rhs);
|
||||
bool is_strictly_equal(Value lhs, Value rhs);
|
||||
bool same_value(Value lhs, Value rhs);
|
||||
bool same_value_zero(Value lhs, Value rhs);
|
||||
JS_API bool same_value(Value lhs, Value rhs);
|
||||
JS_API bool same_value_zero(Value lhs, Value rhs);
|
||||
bool same_value_non_number(Value lhs, Value rhs);
|
||||
ThrowCompletionOr<TriState> is_less_than(VM&, Value lhs, Value rhs, bool left_first);
|
||||
|
||||
|
@ -535,7 +536,7 @@ enum class NumberToStringMode {
|
|||
WithExponent,
|
||||
WithoutExponent,
|
||||
};
|
||||
[[nodiscard]] String number_to_string(double, NumberToStringMode = NumberToStringMode::WithExponent);
|
||||
[[nodiscard]] JS_API String number_to_string(double, NumberToStringMode = NumberToStringMode::WithExponent);
|
||||
[[nodiscard]] ByteString number_to_byte_string(double, NumberToStringMode = NumberToStringMode::WithExponent);
|
||||
double string_to_number(StringView);
|
||||
|
||||
|
|
|
@ -9,13 +9,14 @@
|
|||
#include <AK/NonnullRefPtr.h>
|
||||
#include <LibGC/Ptr.h>
|
||||
#include <LibGC/Root.h>
|
||||
#include <LibJS/Export.h>
|
||||
#include <LibJS/ParserError.h>
|
||||
#include <LibJS/Runtime/Realm.h>
|
||||
|
||||
namespace JS {
|
||||
|
||||
// 16.1.4 Script Records, https://tc39.es/ecma262/#sec-script-records
|
||||
class Script final : public Cell {
|
||||
class JS_API Script final : public Cell {
|
||||
GC_CELL(Script, Cell);
|
||||
GC_DECLARE_ALLOCATOR(Script);
|
||||
|
||||
|
|
|
@ -8,12 +8,13 @@
|
|||
|
||||
#include <AK/String.h>
|
||||
#include <AK/Vector.h>
|
||||
#include <LibJS/Export.h>
|
||||
#include <LibJS/Forward.h>
|
||||
#include <LibJS/Position.h>
|
||||
|
||||
namespace JS {
|
||||
|
||||
class SourceCode : public RefCounted<SourceCode> {
|
||||
class JS_API SourceCode : public RefCounted<SourceCode> {
|
||||
public:
|
||||
static NonnullRefPtr<SourceCode const> create(String filename, String code);
|
||||
|
||||
|
|
|
@ -10,12 +10,13 @@
|
|||
#include <AK/NonnullRefPtr.h>
|
||||
#include <AK/StringView.h>
|
||||
#include <AK/Types.h>
|
||||
#include <LibJS/Export.h>
|
||||
#include <LibJS/Position.h>
|
||||
#include <LibJS/SourceCode.h>
|
||||
|
||||
namespace JS {
|
||||
|
||||
struct SourceRange {
|
||||
struct JS_API SourceRange {
|
||||
[[nodiscard]] bool contains(Position const& position) const { return position.offset <= end.offset && position.offset >= start.offset; }
|
||||
|
||||
NonnullRefPtr<SourceCode const> code;
|
||||
|
|
|
@ -8,13 +8,14 @@
|
|||
#pragma once
|
||||
|
||||
#include <LibJS/CyclicModule.h>
|
||||
#include <LibJS/Export.h>
|
||||
#include <LibJS/Forward.h>
|
||||
#include <LibJS/Runtime/ExecutionContext.h>
|
||||
|
||||
namespace JS {
|
||||
|
||||
// 16.2.1.6 Source Text Module Records, https://tc39.es/ecma262/#sec-source-text-module-records
|
||||
class SourceTextModule final : public CyclicModule {
|
||||
class JS_API SourceTextModule final : public CyclicModule {
|
||||
GC_CELL(SourceTextModule, CyclicModule);
|
||||
GC_DECLARE_ALLOCATOR(SourceTextModule);
|
||||
|
||||
|
|
|
@ -6,11 +6,12 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include <LibJS/Export.h>
|
||||
#include <LibSyntax/Highlighter.h>
|
||||
|
||||
namespace JS {
|
||||
|
||||
class SyntaxHighlighter : public Syntax::Highlighter {
|
||||
class JS_API SyntaxHighlighter : public Syntax::Highlighter {
|
||||
public:
|
||||
SyntaxHighlighter() = default;
|
||||
virtual ~SyntaxHighlighter() override = default;
|
||||
|
|
|
@ -1054,19 +1054,4 @@ if (ENABLE_SWIFT)
|
|||
)
|
||||
target_link_libraries(LibWeb PRIVATE AK Collections)
|
||||
add_swift_target_properties(LibWeb LAGOM_LIBRARIES AK LibGfx LibGC)
|
||||
elseif (WIN32)
|
||||
# FIXME: This is a hack to get around lld-link error undefined symbol JS::BigInt::cell_allocator
|
||||
# LibJS BigInt.obj and other .obj's it depends on is given directly to LibWeb linker
|
||||
target_link_libraries(LibWeb PRIVATE
|
||||
$<FILTER:$<TARGET_OBJECTS:LibJS>,INCLUDE,BigInt>
|
||||
$<FILTER:$<TARGET_OBJECTS:LibJS>,INCLUDE,ErrorType>
|
||||
)
|
||||
|
||||
# FIXME: This is a hack to get around lld-link error undefined symbol JS::GlobalEnvironment::cell_allocator
|
||||
# LibJS GlobalEnvironment.obj and other .obj's it depends on is given directly to LibWeb linker
|
||||
target_link_libraries(LibWeb PRIVATE
|
||||
$<FILTER:$<TARGET_OBJECTS:LibJS>,INCLUDE,GlobalEnvironment>
|
||||
$<FILTER:$<TARGET_OBJECTS:LibJS>,INCLUDE,ObjectEnvironment>
|
||||
$<FILTER:$<TARGET_OBJECTS:LibJS>,INCLUDE,DeclarativeEnvironment>
|
||||
)
|
||||
endif()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue