From 001f36eb667813fc13b138795df6cccd69552f09 Mon Sep 17 00:00:00 2001 From: Timothy Flynn Date: Fri, 11 Apr 2025 12:57:49 -0400 Subject: [PATCH] LibWeb/WebDriver: Add a FIXME about allowing `await` in script bodies There will soon only be a couple of remaining script execution WPT promise.py failures. This comment is to explain why. --- Libraries/LibWeb/WebDriver/ExecuteScript.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Libraries/LibWeb/WebDriver/ExecuteScript.cpp b/Libraries/LibWeb/WebDriver/ExecuteScript.cpp index a7db8feccc4..7a5823e2caa 100644 --- a/Libraries/LibWeb/WebDriver/ExecuteScript.cpp +++ b/Libraries/LibWeb/WebDriver/ExecuteScript.cpp @@ -34,6 +34,8 @@ static JS::ThrowCompletionOr execute_a_function_body(HTML::BrowsingCo auto& realm = environment_settings.realm(); auto& global_scope = realm.global_environment(); + // FIXME: This does not handle scripts which contain `await` statements. It is not as as simple as declaring this + // function async, unfortunately. See: https://github.com/w3c/webdriver/issues/1436 auto source_text = ByteString::formatted( R"~~~(function() {{ {}