mirror of
https://github.com/SerenityOS/serenity
synced 2024-10-07 00:19:27 +00:00
LibJS: Add calls to JS_{DECLARE,DEFINE}_ALLOCATOR()
This commit is contained in:
parent
312bc94ac9
commit
d62c0fcbdc
|
@ -16,6 +16,7 @@
|
|||
namespace JS {
|
||||
|
||||
JS_DEFINE_ALLOCATOR(Module);
|
||||
JS_DEFINE_ALLOCATOR(GraphLoadingState);
|
||||
|
||||
Module::Module(Realm& realm, ByteString filename, Script::HostDefined* host_defined)
|
||||
: m_realm(realm)
|
||||
|
|
|
@ -59,6 +59,7 @@ struct ResolvedBinding {
|
|||
// https://tc39.es/ecma262/#graphloadingstate-record
|
||||
struct GraphLoadingState : public Cell {
|
||||
JS_CELL(GraphLoadingState, Cell);
|
||||
JS_DECLARE_ALLOCATOR(GraphLoadingState);
|
||||
|
||||
public:
|
||||
struct HostDefined : Cell {
|
||||
|
|
|
@ -125,6 +125,8 @@ JS_DEFINE_NATIVE_FUNCTION(ErrorPrototype::stack_setter)
|
|||
}
|
||||
|
||||
#define __JS_ENUMERATE(ClassName, snake_name, PrototypeName, ConstructorName, ArrayType) \
|
||||
JS_DEFINE_ALLOCATOR(PrototypeName); \
|
||||
\
|
||||
PrototypeName::PrototypeName(Realm& realm) \
|
||||
: PrototypeObject(realm.intrinsics().error_prototype()) \
|
||||
{ \
|
||||
|
|
|
@ -31,6 +31,7 @@ private:
|
|||
#define DECLARE_NATIVE_ERROR_PROTOTYPE(ClassName, snake_name, PrototypeName, ConstructorName) \
|
||||
class PrototypeName final : public PrototypeObject<PrototypeName, ClassName> { \
|
||||
JS_PROTOTYPE_OBJECT(PrototypeName, ClassName, ClassName); \
|
||||
JS_DECLARE_ALLOCATOR(PrototypeName); \
|
||||
\
|
||||
public: \
|
||||
virtual void initialize(Realm&) override; \
|
||||
|
|
|
@ -17,6 +17,7 @@ JS_DEFINE_ALLOCATOR(RemainingElements);
|
|||
JS_DEFINE_ALLOCATOR(PromiseValueList);
|
||||
JS_DEFINE_ALLOCATOR(PromiseResolvingElementFunction);
|
||||
JS_DEFINE_ALLOCATOR(PromiseAllResolveElementFunction);
|
||||
JS_DEFINE_ALLOCATOR(PromiseAllSettledResolveElementFunction);
|
||||
JS_DEFINE_ALLOCATOR(PromiseAllSettledRejectElementFunction);
|
||||
JS_DEFINE_ALLOCATOR(PromiseAnyRejectElementFunction);
|
||||
|
||||
|
|
|
@ -88,6 +88,7 @@ private:
|
|||
// 27.2.4.2.2 Promise.allSettled Resolve Element Functions, https://tc39.es/ecma262/#sec-promise.allsettled-resolve-element-functions
|
||||
class PromiseAllSettledResolveElementFunction final : public PromiseResolvingElementFunction {
|
||||
JS_OBJECT(PromiseResolvingFunction, NativeFunction);
|
||||
JS_DECLARE_ALLOCATOR(PromiseAllSettledResolveElementFunction);
|
||||
|
||||
public:
|
||||
static NonnullGCPtr<PromiseAllSettledResolveElementFunction> create(Realm&, size_t, PromiseValueList&, NonnullGCPtr<PromiseCapability const>, RemainingElements&);
|
||||
|
|
|
@ -15,6 +15,8 @@
|
|||
|
||||
namespace JS {
|
||||
|
||||
JS_DEFINE_ALLOCATOR(SetPrototype);
|
||||
|
||||
SetPrototype::SetPrototype(Realm& realm)
|
||||
: PrototypeObject(realm.intrinsics().object_prototype())
|
||||
{
|
||||
|
|
|
@ -13,6 +13,7 @@ namespace JS {
|
|||
|
||||
class SetPrototype final : public PrototypeObject<SetPrototype, Set> {
|
||||
JS_PROTOTYPE_OBJECT(SetPrototype, Set, Set);
|
||||
JS_DECLARE_ALLOCATOR(SetPrototype);
|
||||
|
||||
public:
|
||||
virtual void initialize(Realm&) override;
|
||||
|
|
|
@ -10,6 +10,8 @@
|
|||
|
||||
namespace JS {
|
||||
|
||||
JS_DEFINE_ALLOCATOR(WrapForValidIteratorPrototype);
|
||||
|
||||
// 3.1.1.2.2.1 The %WrapForValidIteratorPrototype% Object, https://tc39.es/proposal-iterator-helpers/#sec-wrapforvaliditeratorprototype-object
|
||||
WrapForValidIteratorPrototype::WrapForValidIteratorPrototype(Realm& realm)
|
||||
: PrototypeObject(realm.intrinsics().iterator_prototype())
|
||||
|
|
|
@ -14,6 +14,7 @@ namespace JS {
|
|||
|
||||
class WrapForValidIteratorPrototype final : public PrototypeObject<WrapForValidIteratorPrototype, Iterator> {
|
||||
JS_PROTOTYPE_OBJECT(WrapForValidIteratorPrototype, Iterator, Iterator);
|
||||
JS_DECLARE_ALLOCATOR(WrapForValidIteratorPrototype);
|
||||
|
||||
public:
|
||||
virtual void initialize(Realm&) override;
|
||||
|
|
Loading…
Reference in a new issue