From c2326ec95a994c2e2e93fd39371e77014d6c26be Mon Sep 17 00:00:00 2001 From: Linus Groh Date: Sun, 2 Oct 2022 10:59:22 +0100 Subject: [PATCH] LibJS: Move PromiseCapability into its own cpp/h file This is not strictly connected to PromiseReaction in any way. Preparation before doing some actual work on it :^) --- Userland/Libraries/LibJS/AST.cpp | 2 +- Userland/Libraries/LibJS/CMakeLists.txt | 1 + Userland/Libraries/LibJS/CyclicModule.cpp | 3 +- Userland/Libraries/LibJS/CyclicModule.h | 2 +- .../AsyncFromSyncIteratorPrototype.cpp | 2 +- .../Runtime/AsyncFunctionDriverWrapper.cpp | 2 +- .../LibJS/Runtime/AsyncGeneratorRequest.h | 2 +- .../Libraries/LibJS/Runtime/Completion.cpp | 5 +- .../Runtime/ECMAScriptFunctionObject.cpp | 2 +- Userland/Libraries/LibJS/Runtime/Promise.cpp | 1 + .../LibJS/Runtime/PromiseCapability.cpp | 80 +++++++++++++++++++ .../LibJS/Runtime/PromiseCapability.h | 65 +++++++++++++++ .../LibJS/Runtime/PromiseConstructor.cpp | 2 +- .../Libraries/LibJS/Runtime/PromiseJobs.cpp | 1 + .../LibJS/Runtime/PromisePrototype.cpp | 2 +- .../LibJS/Runtime/PromiseReaction.cpp | 70 +--------------- .../Libraries/LibJS/Runtime/PromiseReaction.h | 61 +------------- .../PromiseResolvingElementFunctions.cpp | 2 +- .../PromiseResolvingElementFunctions.h | 2 +- .../Libraries/LibJS/Runtime/ShadowRealm.cpp | 2 +- Userland/Libraries/LibJS/Runtime/VM.cpp | 3 +- Userland/Libraries/LibWeb/Fetch/Body.cpp | 2 +- .../Fetch/Infrastructure/HTTP/Bodies.cpp | 2 +- Userland/Libraries/LibWeb/WebIDL/Promise.cpp | 1 + Userland/Libraries/LibWeb/WebIDL/Promise.h | 2 - 25 files changed, 175 insertions(+), 144 deletions(-) create mode 100644 Userland/Libraries/LibJS/Runtime/PromiseCapability.cpp create mode 100644 Userland/Libraries/LibJS/Runtime/PromiseCapability.h diff --git a/Userland/Libraries/LibJS/AST.cpp b/Userland/Libraries/LibJS/AST.cpp index 0443013e1f..3bd1a28376 100644 --- a/Userland/Libraries/LibJS/AST.cpp +++ b/Userland/Libraries/LibJS/AST.cpp @@ -29,8 +29,8 @@ #include #include #include +#include #include -#include #include #include #include diff --git a/Userland/Libraries/LibJS/CMakeLists.txt b/Userland/Libraries/LibJS/CMakeLists.txt index 0d575b0a36..4c05bb3ba8 100644 --- a/Userland/Libraries/LibJS/CMakeLists.txt +++ b/Userland/Libraries/LibJS/CMakeLists.txt @@ -155,6 +155,7 @@ set(SOURCES Runtime/PrimitiveString.cpp Runtime/PrivateEnvironment.cpp Runtime/Promise.cpp + Runtime/PromiseCapability.cpp Runtime/PromiseConstructor.cpp Runtime/PromiseJobs.cpp Runtime/PromisePrototype.cpp diff --git a/Userland/Libraries/LibJS/CyclicModule.cpp b/Userland/Libraries/LibJS/CyclicModule.cpp index 4a2b4f70d0..b98d9c84bb 100644 --- a/Userland/Libraries/LibJS/CyclicModule.cpp +++ b/Userland/Libraries/LibJS/CyclicModule.cpp @@ -5,8 +5,9 @@ */ #include +#include #include -#include +#include namespace JS { diff --git a/Userland/Libraries/LibJS/CyclicModule.h b/Userland/Libraries/LibJS/CyclicModule.h index 2c710d51a8..00facbefcb 100644 --- a/Userland/Libraries/LibJS/CyclicModule.h +++ b/Userland/Libraries/LibJS/CyclicModule.h @@ -10,7 +10,7 @@ #include #include #include -#include +#include namespace JS { diff --git a/Userland/Libraries/LibJS/Runtime/AsyncFromSyncIteratorPrototype.cpp b/Userland/Libraries/LibJS/Runtime/AsyncFromSyncIteratorPrototype.cpp index 83c913d77e..1b3aa73bc4 100644 --- a/Userland/Libraries/LibJS/Runtime/AsyncFromSyncIteratorPrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/AsyncFromSyncIteratorPrototype.cpp @@ -9,8 +9,8 @@ #include #include #include +#include #include -#include namespace JS { diff --git a/Userland/Libraries/LibJS/Runtime/AsyncFunctionDriverWrapper.cpp b/Userland/Libraries/LibJS/Runtime/AsyncFunctionDriverWrapper.cpp index becbb47c87..d6977d61a9 100644 --- a/Userland/Libraries/LibJS/Runtime/AsyncFunctionDriverWrapper.cpp +++ b/Userland/Libraries/LibJS/Runtime/AsyncFunctionDriverWrapper.cpp @@ -7,7 +7,7 @@ #include #include #include -#include +#include #include namespace JS { diff --git a/Userland/Libraries/LibJS/Runtime/AsyncGeneratorRequest.h b/Userland/Libraries/LibJS/Runtime/AsyncGeneratorRequest.h index 14270be7b1..ddfd38857b 100644 --- a/Userland/Libraries/LibJS/Runtime/AsyncGeneratorRequest.h +++ b/Userland/Libraries/LibJS/Runtime/AsyncGeneratorRequest.h @@ -7,7 +7,7 @@ #pragma once #include -#include +#include namespace JS { diff --git a/Userland/Libraries/LibJS/Runtime/Completion.cpp b/Userland/Libraries/LibJS/Runtime/Completion.cpp index 7f2ba12152..ebd4852178 100644 --- a/Userland/Libraries/LibJS/Runtime/Completion.cpp +++ b/Userland/Libraries/LibJS/Runtime/Completion.cpp @@ -6,12 +6,11 @@ */ #include -#include #include -#include #include +#include +#include #include -#include #include #include diff --git a/Userland/Libraries/LibJS/Runtime/ECMAScriptFunctionObject.cpp b/Userland/Libraries/LibJS/Runtime/ECMAScriptFunctionObject.cpp index dd0455455a..1341da4f49 100644 --- a/Userland/Libraries/LibJS/Runtime/ECMAScriptFunctionObject.cpp +++ b/Userland/Libraries/LibJS/Runtime/ECMAScriptFunctionObject.cpp @@ -22,8 +22,8 @@ #include #include #include +#include #include -#include #include namespace JS { diff --git a/Userland/Libraries/LibJS/Runtime/Promise.cpp b/Userland/Libraries/LibJS/Runtime/Promise.cpp index 4b6d5d74e5..40637f2151 100644 --- a/Userland/Libraries/LibJS/Runtime/Promise.cpp +++ b/Userland/Libraries/LibJS/Runtime/Promise.cpp @@ -12,6 +12,7 @@ #include #include #include +#include #include #include #include diff --git a/Userland/Libraries/LibJS/Runtime/PromiseCapability.cpp b/Userland/Libraries/LibJS/Runtime/PromiseCapability.cpp new file mode 100644 index 0000000000..b75cf4093c --- /dev/null +++ b/Userland/Libraries/LibJS/Runtime/PromiseCapability.cpp @@ -0,0 +1,80 @@ +/* + * Copyright (c) 2021-2022, Linus Groh + * + * SPDX-License-Identifier: BSD-2-Clause + */ + +#include +#include +#include +#include + +namespace JS { + +// 27.2.1.5 NewPromiseCapability ( C ), https://tc39.es/ecma262/#sec-newpromisecapability +ThrowCompletionOr new_promise_capability(VM& vm, Value constructor) +{ + auto& realm = *vm.current_realm(); + + // 1. If IsConstructor(C) is false, throw a TypeError exception. + if (!constructor.is_constructor()) + return vm.throw_completion(ErrorType::NotAConstructor, constructor.to_string_without_side_effects()); + + // 2. NOTE: C is assumed to be a constructor function that supports the parameter conventions of the Promise constructor (see 27.2.3.1). + + // 3. Let promiseCapability be the PromiseCapability Record { [[Promise]]: undefined, [[Resolve]]: undefined, [[Reject]]: undefined }. + // FIXME: This should not be stack-allocated, the executor function below can be captured and outlive it! + // See https://discord.com/channels/830522505605283862/886211697843531866/900081190621569154 for some discussion. + struct { + Value resolve { js_undefined() }; + Value reject { js_undefined() }; + } promise_capability_functions; + + // 4. Let executorClosure be a new Abstract Closure with parameters (resolve, reject) that captures promiseCapability and performs the following steps when called: + auto executor_closure = [&promise_capability_functions](auto& vm) -> ThrowCompletionOr { + auto resolve = vm.argument(0); + auto reject = vm.argument(1); + + // No idea what other engines say here. + // a. If promiseCapability.[[Resolve]] is not undefined, throw a TypeError exception. + if (!promise_capability_functions.resolve.is_undefined()) + return vm.template throw_completion(ErrorType::GetCapabilitiesExecutorCalledMultipleTimes); + + // b. If promiseCapability.[[Reject]] is not undefined, throw a TypeError exception. + if (!promise_capability_functions.reject.is_undefined()) + return vm.template throw_completion(ErrorType::GetCapabilitiesExecutorCalledMultipleTimes); + + // c. Set promiseCapability.[[Resolve]] to resolve. + promise_capability_functions.resolve = resolve; + + // d. Set promiseCapability.[[Reject]] to reject. + promise_capability_functions.reject = reject; + + // e. Return undefined. + return js_undefined(); + }; + + // 5. Let executor be CreateBuiltinFunction(executorClosure, 2, "", « »). + auto* executor = NativeFunction::create(realm, move(executor_closure), 2, ""); + + // 6. Let promise be ? Construct(C, « executor »). + auto* promise = TRY(construct(vm, constructor.as_function(), executor)); + + // 7. If IsCallable(promiseCapability.[[Resolve]]) is false, throw a TypeError exception. + if (!promise_capability_functions.resolve.is_function()) + return vm.throw_completion(ErrorType::NotAFunction, promise_capability_functions.resolve.to_string_without_side_effects()); + + // 8. If IsCallable(promiseCapability.[[Reject]]) is false, throw a TypeError exception. + if (!promise_capability_functions.reject.is_function()) + return vm.throw_completion(ErrorType::NotAFunction, promise_capability_functions.reject.to_string_without_side_effects()); + + // 9. Set promiseCapability.[[Promise]] to promise. + // 10. Return promiseCapability. + return PromiseCapability { + promise, + &promise_capability_functions.resolve.as_function(), + &promise_capability_functions.reject.as_function(), + }; +} + +} diff --git a/Userland/Libraries/LibJS/Runtime/PromiseCapability.h b/Userland/Libraries/LibJS/Runtime/PromiseCapability.h new file mode 100644 index 0000000000..12d88b542f --- /dev/null +++ b/Userland/Libraries/LibJS/Runtime/PromiseCapability.h @@ -0,0 +1,65 @@ +/* + * Copyright (c) 2021-2022, Linus Groh + * + * SPDX-License-Identifier: BSD-2-Clause + */ + +#pragma once + +#include +#include +#include + +namespace JS { + +// 27.2.1.1 PromiseCapability Records, https://tc39.es/ecma262/#sec-promisecapability-records +struct PromiseCapability { + Object* promise { nullptr }; + FunctionObject* resolve { nullptr }; + FunctionObject* reject { nullptr }; +}; + +// 27.2.1.1.1 IfAbruptRejectPromise ( value, capability ), https://tc39.es/ecma262/#sec-ifabruptrejectpromise +#define __TRY_OR_REJECT(vm, capability, expression, CALL_CHECK) \ + ({ \ + auto _temporary_try_or_reject_result = (expression); \ + /* 1. If value is an abrupt completion, then */ \ + if (_temporary_try_or_reject_result.is_error()) { \ + /* a. Perform ? Call(capability.[[Reject]], undefined, « value.[[Value]] »). */ \ + CALL_CHECK(JS::call(vm, *capability.reject, js_undefined(), *_temporary_try_or_reject_result.release_error().value())); \ + \ + /* b. Return capability.[[Promise]]. */ \ + return capability.promise; \ + } \ + \ + /* 2. Else if value is a Completion Record, set value to value.[[Value]]. */ \ + _temporary_try_or_reject_result.release_value(); \ + }) + +#define TRY_OR_REJECT(vm, capability, expression) \ + __TRY_OR_REJECT(vm, capability, expression, TRY) + +#define TRY_OR_MUST_REJECT(vm, capability, expression) \ + __TRY_OR_REJECT(vm, capability, expression, MUST) + +// 27.2.1.1.1 IfAbruptRejectPromise ( value, capability ), https://tc39.es/ecma262/#sec-ifabruptrejectpromise +#define TRY_OR_REJECT_WITH_VALUE(vm, capability, expression) \ + ({ \ + auto _temporary_try_or_reject_result = (expression); \ + /* 1. If value is an abrupt completion, then */ \ + if (_temporary_try_or_reject_result.is_error()) { \ + /* a. Perform ? Call(capability.[[Reject]], undefined, « value.[[Value]] »). */ \ + TRY(JS::call(vm, *capability.reject, js_undefined(), *_temporary_try_or_reject_result.release_error().value())); \ + \ + /* b. Return capability.[[Promise]]. */ \ + return Value { capability.promise }; \ + } \ + \ + /* 2. Else if value is a Completion Record, set value to value.[[Value]]. */ \ + _temporary_try_or_reject_result.release_value(); \ + }) + +// 27.2.1.5 NewPromiseCapability ( C ), https://tc39.es/ecma262/#sec-newpromisecapability +ThrowCompletionOr new_promise_capability(VM& vm, Value constructor); + +} diff --git a/Userland/Libraries/LibJS/Runtime/PromiseConstructor.cpp b/Userland/Libraries/LibJS/Runtime/PromiseConstructor.cpp index 4868d8a40d..2aead988f0 100644 --- a/Userland/Libraries/LibJS/Runtime/PromiseConstructor.cpp +++ b/Userland/Libraries/LibJS/Runtime/PromiseConstructor.cpp @@ -14,8 +14,8 @@ #include #include #include +#include #include -#include #include namespace JS { diff --git a/Userland/Libraries/LibJS/Runtime/PromiseJobs.cpp b/Userland/Libraries/LibJS/Runtime/PromiseJobs.cpp index 15a579b188..a31ed65060 100644 --- a/Userland/Libraries/LibJS/Runtime/PromiseJobs.cpp +++ b/Userland/Libraries/LibJS/Runtime/PromiseJobs.cpp @@ -10,6 +10,7 @@ #include #include #include +#include #include #include diff --git a/Userland/Libraries/LibJS/Runtime/PromisePrototype.cpp b/Userland/Libraries/LibJS/Runtime/PromisePrototype.cpp index 04fb7e4530..e14fe7e5d5 100644 --- a/Userland/Libraries/LibJS/Runtime/PromisePrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/PromisePrototype.cpp @@ -10,9 +10,9 @@ #include #include #include +#include #include #include -#include namespace JS { diff --git a/Userland/Libraries/LibJS/Runtime/PromiseReaction.cpp b/Userland/Libraries/LibJS/Runtime/PromiseReaction.cpp index f81d1a0118..a6f2e392e0 100644 --- a/Userland/Libraries/LibJS/Runtime/PromiseReaction.cpp +++ b/Userland/Libraries/LibJS/Runtime/PromiseReaction.cpp @@ -4,77 +4,15 @@ * SPDX-License-Identifier: BSD-2-Clause */ -#include -#include -#include +#include #include +#include namespace JS { -// 27.2.1.5 NewPromiseCapability ( C ), https://tc39.es/ecma262/#sec-newpromisecapability -ThrowCompletionOr new_promise_capability(VM& vm, Value constructor) +PromiseReaction* PromiseReaction::create(VM& vm, Type type, Optional capability, Optional handler) { - auto& realm = *vm.current_realm(); - - // 1. If IsConstructor(C) is false, throw a TypeError exception. - if (!constructor.is_constructor()) - return vm.throw_completion(ErrorType::NotAConstructor, constructor.to_string_without_side_effects()); - - // 2. NOTE: C is assumed to be a constructor function that supports the parameter conventions of the Promise constructor (see 27.2.3.1). - - // 3. Let promiseCapability be the PromiseCapability Record { [[Promise]]: undefined, [[Resolve]]: undefined, [[Reject]]: undefined }. - // FIXME: This should not be stack-allocated, the executor function below can be captured and outlive it! - // See https://discord.com/channels/830522505605283862/886211697843531866/900081190621569154 for some discussion. - struct { - Value resolve { js_undefined() }; - Value reject { js_undefined() }; - } promise_capability_functions; - - // 4. Let executorClosure be a new Abstract Closure with parameters (resolve, reject) that captures promiseCapability and performs the following steps when called: - auto executor_closure = [&promise_capability_functions](auto& vm) -> ThrowCompletionOr { - auto resolve = vm.argument(0); - auto reject = vm.argument(1); - - // No idea what other engines say here. - // a. If promiseCapability.[[Resolve]] is not undefined, throw a TypeError exception. - if (!promise_capability_functions.resolve.is_undefined()) - return vm.template throw_completion(ErrorType::GetCapabilitiesExecutorCalledMultipleTimes); - - // b. If promiseCapability.[[Reject]] is not undefined, throw a TypeError exception. - if (!promise_capability_functions.reject.is_undefined()) - return vm.template throw_completion(ErrorType::GetCapabilitiesExecutorCalledMultipleTimes); - - // c. Set promiseCapability.[[Resolve]] to resolve. - promise_capability_functions.resolve = resolve; - - // d. Set promiseCapability.[[Reject]] to reject. - promise_capability_functions.reject = reject; - - // e. Return undefined. - return js_undefined(); - }; - - // 5. Let executor be CreateBuiltinFunction(executorClosure, 2, "", « »). - auto* executor = NativeFunction::create(realm, move(executor_closure), 2, ""); - - // 6. Let promise be ? Construct(C, « executor »). - auto* promise = TRY(construct(vm, constructor.as_function(), executor)); - - // 7. If IsCallable(promiseCapability.[[Resolve]]) is false, throw a TypeError exception. - if (!promise_capability_functions.resolve.is_function()) - return vm.throw_completion(ErrorType::NotAFunction, promise_capability_functions.resolve.to_string_without_side_effects()); - - // 8. If IsCallable(promiseCapability.[[Reject]]) is false, throw a TypeError exception. - if (!promise_capability_functions.reject.is_function()) - return vm.throw_completion(ErrorType::NotAFunction, promise_capability_functions.reject.to_string_without_side_effects()); - - // 9. Set promiseCapability.[[Promise]] to promise. - // 10. Return promiseCapability. - return PromiseCapability { - promise, - &promise_capability_functions.resolve.as_function(), - &promise_capability_functions.reject.as_function(), - }; + return vm.heap().allocate_without_realm(type, move(capability), move(handler)); } PromiseReaction::PromiseReaction(Type type, Optional capability, Optional handler) diff --git a/Userland/Libraries/LibJS/Runtime/PromiseReaction.h b/Userland/Libraries/LibJS/Runtime/PromiseReaction.h index 966d22094f..58d6dd63af 100644 --- a/Userland/Libraries/LibJS/Runtime/PromiseReaction.h +++ b/Userland/Libraries/LibJS/Runtime/PromiseReaction.h @@ -6,63 +6,13 @@ #pragma once -#include -#include +#include +#include +#include #include -#include namespace JS { -// 27.2.1.1 PromiseCapability Records, https://tc39.es/ecma262/#sec-promisecapability-records -struct PromiseCapability { - Object* promise { nullptr }; - FunctionObject* resolve { nullptr }; - FunctionObject* reject { nullptr }; -}; - -// 27.2.1.1.1 IfAbruptRejectPromise ( value, capability ), https://tc39.es/ecma262/#sec-ifabruptrejectpromise -#define __TRY_OR_REJECT(vm, capability, expression, CALL_CHECK) \ - ({ \ - auto _temporary_try_or_reject_result = (expression); \ - /* 1. If value is an abrupt completion, then */ \ - if (_temporary_try_or_reject_result.is_error()) { \ - /* a. Perform ? Call(capability.[[Reject]], undefined, « value.[[Value]] »). */ \ - CALL_CHECK(JS::call(vm, *capability.reject, js_undefined(), *_temporary_try_or_reject_result.release_error().value())); \ - \ - /* b. Return capability.[[Promise]]. */ \ - return capability.promise; \ - } \ - \ - /* 2. Else if value is a Completion Record, set value to value.[[Value]]. */ \ - _temporary_try_or_reject_result.release_value(); \ - }) - -#define TRY_OR_REJECT(vm, capability, expression) \ - __TRY_OR_REJECT(vm, capability, expression, TRY) - -#define TRY_OR_MUST_REJECT(vm, capability, expression) \ - __TRY_OR_REJECT(vm, capability, expression, MUST) - -// 27.2.1.1.1 IfAbruptRejectPromise ( value, capability ), https://tc39.es/ecma262/#sec-ifabruptrejectpromise -#define TRY_OR_REJECT_WITH_VALUE(vm, capability, expression) \ - ({ \ - auto _temporary_try_or_reject_result = (expression); \ - /* 1. If value is an abrupt completion, then */ \ - if (_temporary_try_or_reject_result.is_error()) { \ - /* a. Perform ? Call(capability.[[Reject]], undefined, « value.[[Value]] »). */ \ - TRY(JS::call(vm, *capability.reject, js_undefined(), *_temporary_try_or_reject_result.release_error().value())); \ - \ - /* b. Return capability.[[Promise]]. */ \ - return Value { capability.promise }; \ - } \ - \ - /* 2. Else if value is a Completion Record, set value to value.[[Value]]. */ \ - _temporary_try_or_reject_result.release_value(); \ - }) - -// 27.2.1.5 NewPromiseCapability ( C ), https://tc39.es/ecma262/#sec-newpromisecapability -ThrowCompletionOr new_promise_capability(VM& vm, Value constructor); - // 27.2.1.2 PromiseReaction Records, https://tc39.es/ecma262/#sec-promisereaction-records class PromiseReaction final : public Cell { JS_CELL(PromiseReaction, Cell); @@ -73,10 +23,7 @@ public: Reject, }; - static PromiseReaction* create(VM& vm, Type type, Optional capability, Optional handler) - { - return vm.heap().allocate_without_realm(type, capability, move(handler)); - } + static PromiseReaction* create(VM& vm, Type type, Optional capability, Optional handler); virtual ~PromiseReaction() = default; diff --git a/Userland/Libraries/LibJS/Runtime/PromiseResolvingElementFunctions.cpp b/Userland/Libraries/LibJS/Runtime/PromiseResolvingElementFunctions.cpp index 2a47562949..a967474cd3 100644 --- a/Userland/Libraries/LibJS/Runtime/PromiseResolvingElementFunctions.cpp +++ b/Userland/Libraries/LibJS/Runtime/PromiseResolvingElementFunctions.cpp @@ -8,7 +8,7 @@ #include #include #include -#include +#include #include namespace JS { diff --git a/Userland/Libraries/LibJS/Runtime/PromiseResolvingElementFunctions.h b/Userland/Libraries/LibJS/Runtime/PromiseResolvingElementFunctions.h index d878d7612f..62cb018009 100644 --- a/Userland/Libraries/LibJS/Runtime/PromiseResolvingElementFunctions.h +++ b/Userland/Libraries/LibJS/Runtime/PromiseResolvingElementFunctions.h @@ -8,7 +8,7 @@ #include #include -#include +#include namespace JS { diff --git a/Userland/Libraries/LibJS/Runtime/ShadowRealm.cpp b/Userland/Libraries/LibJS/Runtime/ShadowRealm.cpp index ff7e6dd6d5..74b4cad7f4 100644 --- a/Userland/Libraries/LibJS/Runtime/ShadowRealm.cpp +++ b/Userland/Libraries/LibJS/Runtime/ShadowRealm.cpp @@ -12,8 +12,8 @@ #include #include #include +#include #include -#include #include #include diff --git a/Userland/Libraries/LibJS/Runtime/VM.cpp b/Userland/Libraries/LibJS/Runtime/VM.cpp index 30a3e5aaf6..1b15a1571d 100644 --- a/Userland/Libraries/LibJS/Runtime/VM.cpp +++ b/Userland/Libraries/LibJS/Runtime/VM.cpp @@ -20,10 +20,9 @@ #include #include #include -#include #include #include -#include +#include #include #include #include diff --git a/Userland/Libraries/LibWeb/Fetch/Body.cpp b/Userland/Libraries/LibWeb/Fetch/Body.cpp index 7e06d75f26..7cc9dbc285 100644 --- a/Userland/Libraries/LibWeb/Fetch/Body.cpp +++ b/Userland/Libraries/LibWeb/Fetch/Body.cpp @@ -6,7 +6,7 @@ #include #include -#include +#include #include #include #include diff --git a/Userland/Libraries/LibWeb/Fetch/Infrastructure/HTTP/Bodies.cpp b/Userland/Libraries/LibWeb/Fetch/Infrastructure/HTTP/Bodies.cpp index eb4e74858e..7b08e08058 100644 --- a/Userland/Libraries/LibWeb/Fetch/Infrastructure/HTTP/Bodies.cpp +++ b/Userland/Libraries/LibWeb/Fetch/Infrastructure/HTTP/Bodies.cpp @@ -4,7 +4,7 @@ * SPDX-License-Identifier: BSD-2-Clause */ -#include +#include #include #include #include diff --git a/Userland/Libraries/LibWeb/WebIDL/Promise.cpp b/Userland/Libraries/LibWeb/WebIDL/Promise.cpp index 17b42d8c0a..ad726919e2 100644 --- a/Userland/Libraries/LibWeb/WebIDL/Promise.cpp +++ b/Userland/Libraries/LibWeb/WebIDL/Promise.cpp @@ -5,6 +5,7 @@ */ #include +#include #include #include #include diff --git a/Userland/Libraries/LibWeb/WebIDL/Promise.h b/Userland/Libraries/LibWeb/WebIDL/Promise.h index 65122b59df..43a9336a45 100644 --- a/Userland/Libraries/LibWeb/WebIDL/Promise.h +++ b/Userland/Libraries/LibWeb/WebIDL/Promise.h @@ -7,8 +7,6 @@ #pragma once #include -#include -#include #include #include