mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-26 09:30:24 +00:00
LibJS: Fix a few const-ness issues
This commit is contained in:
parent
5f0ccfb499
commit
74e93a46ea
Notes:
sideshowbarker
2024-07-17 06:24:08 +09:00
Author: https://github.com/mattco98 Commit: https://github.com/SerenityOS/serenity/commit/74e93a46ea Pull-request: https://github.com/SerenityOS/serenity/pull/17620 Issue: https://github.com/SerenityOS/serenity/issues/16988 Reviewed-by: https://github.com/ADKaster ✅ Reviewed-by: https://github.com/linusg
4 changed files with 21 additions and 21 deletions
|
@ -190,7 +190,7 @@ static ThrowCompletionOr<Value> perform_promise_all_settled(VM& vm, Iterator& it
|
|||
}
|
||||
|
||||
// 27.2.4.3.1 PerformPromiseAny ( iteratorRecord, constructor, resultCapability, promiseResolve ), https://tc39.es/ecma262/#sec-performpromiseany
|
||||
static ThrowCompletionOr<Value> perform_promise_any(VM& vm, Iterator& iterator_record, Value constructor, PromiseCapability const& result_capability, Value promise_resolve)
|
||||
static ThrowCompletionOr<Value> perform_promise_any(VM& vm, Iterator& iterator_record, Value constructor, PromiseCapability& result_capability, Value promise_resolve)
|
||||
{
|
||||
auto& realm = *vm.current_realm();
|
||||
|
||||
|
|
|
@ -20,7 +20,7 @@ void PromiseValueList::visit_edges(Visitor& visitor)
|
|||
visitor.visit(val);
|
||||
}
|
||||
|
||||
PromiseResolvingElementFunction::PromiseResolvingElementFunction(size_t index, PromiseValueList& values, NonnullGCPtr<PromiseCapability> capability, RemainingElements& remaining_elements, Object& prototype)
|
||||
PromiseResolvingElementFunction::PromiseResolvingElementFunction(size_t index, PromiseValueList& values, NonnullGCPtr<PromiseCapability const> capability, RemainingElements& remaining_elements, Object& prototype)
|
||||
: NativeFunction(prototype)
|
||||
, m_index(index)
|
||||
, m_values(values)
|
||||
|
@ -55,12 +55,12 @@ void PromiseResolvingElementFunction::visit_edges(Cell::Visitor& visitor)
|
|||
visitor.visit(&m_remaining_elements);
|
||||
}
|
||||
|
||||
NonnullGCPtr<PromiseAllResolveElementFunction> PromiseAllResolveElementFunction::create(Realm& realm, size_t index, PromiseValueList& values, NonnullGCPtr<PromiseCapability> capability, RemainingElements& remaining_elements)
|
||||
NonnullGCPtr<PromiseAllResolveElementFunction> PromiseAllResolveElementFunction::create(Realm& realm, size_t index, PromiseValueList& values, NonnullGCPtr<PromiseCapability const> capability, RemainingElements& remaining_elements)
|
||||
{
|
||||
return realm.heap().allocate<PromiseAllResolveElementFunction>(realm, index, values, capability, remaining_elements, *realm.intrinsics().function_prototype()).release_allocated_value_but_fixme_should_propagate_errors();
|
||||
}
|
||||
|
||||
PromiseAllResolveElementFunction::PromiseAllResolveElementFunction(size_t index, PromiseValueList& values, NonnullGCPtr<PromiseCapability> capability, RemainingElements& remaining_elements, Object& prototype)
|
||||
PromiseAllResolveElementFunction::PromiseAllResolveElementFunction(size_t index, PromiseValueList& values, NonnullGCPtr<PromiseCapability const> capability, RemainingElements& remaining_elements, Object& prototype)
|
||||
: PromiseResolvingElementFunction(index, values, capability, remaining_elements, prototype)
|
||||
{
|
||||
}
|
||||
|
@ -87,12 +87,12 @@ ThrowCompletionOr<Value> PromiseAllResolveElementFunction::resolve_element()
|
|||
return js_undefined();
|
||||
}
|
||||
|
||||
NonnullGCPtr<PromiseAllSettledResolveElementFunction> PromiseAllSettledResolveElementFunction::create(Realm& realm, size_t index, PromiseValueList& values, NonnullGCPtr<PromiseCapability> capability, RemainingElements& remaining_elements)
|
||||
NonnullGCPtr<PromiseAllSettledResolveElementFunction> PromiseAllSettledResolveElementFunction::create(Realm& realm, size_t index, PromiseValueList& values, NonnullGCPtr<PromiseCapability const> capability, RemainingElements& remaining_elements)
|
||||
{
|
||||
return realm.heap().allocate<PromiseAllSettledResolveElementFunction>(realm, index, values, capability, remaining_elements, *realm.intrinsics().function_prototype()).release_allocated_value_but_fixme_should_propagate_errors();
|
||||
}
|
||||
|
||||
PromiseAllSettledResolveElementFunction::PromiseAllSettledResolveElementFunction(size_t index, PromiseValueList& values, NonnullGCPtr<PromiseCapability> capability, RemainingElements& remaining_elements, Object& prototype)
|
||||
PromiseAllSettledResolveElementFunction::PromiseAllSettledResolveElementFunction(size_t index, PromiseValueList& values, NonnullGCPtr<PromiseCapability const> capability, RemainingElements& remaining_elements, Object& prototype)
|
||||
: PromiseResolvingElementFunction(index, values, capability, remaining_elements, prototype)
|
||||
{
|
||||
}
|
||||
|
@ -128,12 +128,12 @@ ThrowCompletionOr<Value> PromiseAllSettledResolveElementFunction::resolve_elemen
|
|||
return js_undefined();
|
||||
}
|
||||
|
||||
NonnullGCPtr<PromiseAllSettledRejectElementFunction> PromiseAllSettledRejectElementFunction::create(Realm& realm, size_t index, PromiseValueList& values, NonnullGCPtr<PromiseCapability> capability, RemainingElements& remaining_elements)
|
||||
NonnullGCPtr<PromiseAllSettledRejectElementFunction> PromiseAllSettledRejectElementFunction::create(Realm& realm, size_t index, PromiseValueList& values, NonnullGCPtr<PromiseCapability const> capability, RemainingElements& remaining_elements)
|
||||
{
|
||||
return realm.heap().allocate<PromiseAllSettledRejectElementFunction>(realm, index, values, capability, remaining_elements, *realm.intrinsics().function_prototype()).release_allocated_value_but_fixme_should_propagate_errors();
|
||||
}
|
||||
|
||||
PromiseAllSettledRejectElementFunction::PromiseAllSettledRejectElementFunction(size_t index, PromiseValueList& values, NonnullGCPtr<PromiseCapability> capability, RemainingElements& remaining_elements, Object& prototype)
|
||||
PromiseAllSettledRejectElementFunction::PromiseAllSettledRejectElementFunction(size_t index, PromiseValueList& values, NonnullGCPtr<PromiseCapability const> capability, RemainingElements& remaining_elements, Object& prototype)
|
||||
: PromiseResolvingElementFunction(index, values, capability, remaining_elements, prototype)
|
||||
{
|
||||
}
|
||||
|
@ -169,12 +169,12 @@ ThrowCompletionOr<Value> PromiseAllSettledRejectElementFunction::resolve_element
|
|||
return js_undefined();
|
||||
}
|
||||
|
||||
NonnullGCPtr<PromiseAnyRejectElementFunction> PromiseAnyRejectElementFunction::create(Realm& realm, size_t index, PromiseValueList& errors, NonnullGCPtr<PromiseCapability> capability, RemainingElements& remaining_elements)
|
||||
NonnullGCPtr<PromiseAnyRejectElementFunction> PromiseAnyRejectElementFunction::create(Realm& realm, size_t index, PromiseValueList& errors, NonnullGCPtr<PromiseCapability const> capability, RemainingElements& remaining_elements)
|
||||
{
|
||||
return realm.heap().allocate<PromiseAnyRejectElementFunction>(realm, index, errors, capability, remaining_elements, *realm.intrinsics().function_prototype()).release_allocated_value_but_fixme_should_propagate_errors();
|
||||
}
|
||||
|
||||
PromiseAnyRejectElementFunction::PromiseAnyRejectElementFunction(size_t index, PromiseValueList& errors, NonnullGCPtr<PromiseCapability> capability, RemainingElements& remaining_elements, Object& prototype)
|
||||
PromiseAnyRejectElementFunction::PromiseAnyRejectElementFunction(size_t index, PromiseValueList& errors, NonnullGCPtr<PromiseCapability const> capability, RemainingElements& remaining_elements, Object& prototype)
|
||||
: PromiseResolvingElementFunction(index, errors, capability, remaining_elements, prototype)
|
||||
{
|
||||
}
|
||||
|
|
|
@ -51,13 +51,13 @@ public:
|
|||
virtual ThrowCompletionOr<Value> call() override;
|
||||
|
||||
protected:
|
||||
explicit PromiseResolvingElementFunction(size_t, PromiseValueList&, NonnullGCPtr<PromiseCapability>, RemainingElements&, Object& prototype);
|
||||
explicit PromiseResolvingElementFunction(size_t, PromiseValueList&, NonnullGCPtr<PromiseCapability const>, RemainingElements&, Object& prototype);
|
||||
|
||||
virtual ThrowCompletionOr<Value> resolve_element() = 0;
|
||||
|
||||
size_t m_index { 0 };
|
||||
PromiseValueList& m_values;
|
||||
NonnullGCPtr<PromiseCapability> m_capability;
|
||||
NonnullGCPtr<PromiseCapability const> m_capability;
|
||||
RemainingElements& m_remaining_elements;
|
||||
|
||||
private:
|
||||
|
@ -71,12 +71,12 @@ class PromiseAllResolveElementFunction final : public PromiseResolvingElementFun
|
|||
JS_OBJECT(PromiseResolvingFunction, NativeFunction);
|
||||
|
||||
public:
|
||||
static NonnullGCPtr<PromiseAllResolveElementFunction> create(Realm&, size_t, PromiseValueList&, NonnullGCPtr<PromiseCapability>, RemainingElements&);
|
||||
static NonnullGCPtr<PromiseAllResolveElementFunction> create(Realm&, size_t, PromiseValueList&, NonnullGCPtr<PromiseCapability const>, RemainingElements&);
|
||||
|
||||
virtual ~PromiseAllResolveElementFunction() override = default;
|
||||
|
||||
private:
|
||||
explicit PromiseAllResolveElementFunction(size_t, PromiseValueList&, NonnullGCPtr<PromiseCapability>, RemainingElements&, Object& prototype);
|
||||
explicit PromiseAllResolveElementFunction(size_t, PromiseValueList&, NonnullGCPtr<PromiseCapability const>, RemainingElements&, Object& prototype);
|
||||
|
||||
virtual ThrowCompletionOr<Value> resolve_element() override;
|
||||
};
|
||||
|
@ -86,12 +86,12 @@ class PromiseAllSettledResolveElementFunction final : public PromiseResolvingEle
|
|||
JS_OBJECT(PromiseResolvingFunction, NativeFunction);
|
||||
|
||||
public:
|
||||
static NonnullGCPtr<PromiseAllSettledResolveElementFunction> create(Realm&, size_t, PromiseValueList&, NonnullGCPtr<PromiseCapability>, RemainingElements&);
|
||||
static NonnullGCPtr<PromiseAllSettledResolveElementFunction> create(Realm&, size_t, PromiseValueList&, NonnullGCPtr<PromiseCapability const>, RemainingElements&);
|
||||
|
||||
virtual ~PromiseAllSettledResolveElementFunction() override = default;
|
||||
|
||||
private:
|
||||
explicit PromiseAllSettledResolveElementFunction(size_t, PromiseValueList&, NonnullGCPtr<PromiseCapability>, RemainingElements&, Object& prototype);
|
||||
explicit PromiseAllSettledResolveElementFunction(size_t, PromiseValueList&, NonnullGCPtr<PromiseCapability const>, RemainingElements&, Object& prototype);
|
||||
|
||||
virtual ThrowCompletionOr<Value> resolve_element() override;
|
||||
};
|
||||
|
@ -101,12 +101,12 @@ class PromiseAllSettledRejectElementFunction final : public PromiseResolvingElem
|
|||
JS_OBJECT(PromiseResolvingFunction, PromiseResolvingElementFunction);
|
||||
|
||||
public:
|
||||
static NonnullGCPtr<PromiseAllSettledRejectElementFunction> create(Realm&, size_t, PromiseValueList&, NonnullGCPtr<PromiseCapability>, RemainingElements&);
|
||||
static NonnullGCPtr<PromiseAllSettledRejectElementFunction> create(Realm&, size_t, PromiseValueList&, NonnullGCPtr<PromiseCapability const>, RemainingElements&);
|
||||
|
||||
virtual ~PromiseAllSettledRejectElementFunction() override = default;
|
||||
|
||||
private:
|
||||
explicit PromiseAllSettledRejectElementFunction(size_t, PromiseValueList&, NonnullGCPtr<PromiseCapability>, RemainingElements&, Object& prototype);
|
||||
explicit PromiseAllSettledRejectElementFunction(size_t, PromiseValueList&, NonnullGCPtr<PromiseCapability const>, RemainingElements&, Object& prototype);
|
||||
|
||||
virtual ThrowCompletionOr<Value> resolve_element() override;
|
||||
};
|
||||
|
@ -116,12 +116,12 @@ class PromiseAnyRejectElementFunction final : public PromiseResolvingElementFunc
|
|||
JS_OBJECT(PromiseResolvingFunction, PromiseResolvingElementFunction);
|
||||
|
||||
public:
|
||||
static NonnullGCPtr<PromiseAnyRejectElementFunction> create(Realm&, size_t, PromiseValueList&, NonnullGCPtr<PromiseCapability>, RemainingElements&);
|
||||
static NonnullGCPtr<PromiseAnyRejectElementFunction> create(Realm&, size_t, PromiseValueList&, NonnullGCPtr<PromiseCapability const>, RemainingElements&);
|
||||
|
||||
virtual ~PromiseAnyRejectElementFunction() override = default;
|
||||
|
||||
private:
|
||||
explicit PromiseAnyRejectElementFunction(size_t, PromiseValueList&, NonnullGCPtr<PromiseCapability>, RemainingElements&, Object& prototype);
|
||||
explicit PromiseAnyRejectElementFunction(size_t, PromiseValueList&, NonnullGCPtr<PromiseCapability const>, RemainingElements&, Object& prototype);
|
||||
|
||||
virtual ThrowCompletionOr<Value> resolve_element() override;
|
||||
};
|
||||
|
|
|
@ -126,7 +126,7 @@ JS_DEFINE_NATIVE_FUNCTION(SetPrototype::size_getter)
|
|||
|
||||
// 8 Set Records, https://tc39.es/proposal-set-methods/#sec-set-records
|
||||
struct SetRecord {
|
||||
NonnullGCPtr<Object> set; // [[Set]]
|
||||
NonnullGCPtr<Object const> set; // [[Set]]
|
||||
double size { 0 }; // [[Size]
|
||||
NonnullGCPtr<FunctionObject> has; // [[Has]]
|
||||
NonnullGCPtr<FunctionObject> keys; // [[Keys]]
|
||||
|
|
Loading…
Reference in a new issue