summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2021-10-10 02:55:19 +0200
committerAndreas Kling <kling@serenityos.org>2021-10-10 02:55:19 +0200
commit4bf88436cbfa920678b9d7ce9669f1cdedfc7064 (patch)
treecfa9965a1785cda6e3bd09d369b6808921fe316b
parent82da36f129de923a1ed0b34cbecb20d5b96763b8 (diff)
downloadserenity-4bf88436cbfa920678b9d7ce9669f1cdedfc7064.zip
LibWeb: Handle JS exceptions slightly sooner in CSS.escape()
-rw-r--r--Userland/Libraries/LibWeb/Bindings/CSSNamespace.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/Userland/Libraries/LibWeb/Bindings/CSSNamespace.cpp b/Userland/Libraries/LibWeb/Bindings/CSSNamespace.cpp
index d43e86aed7..2ca4d6f42a 100644
--- a/Userland/Libraries/LibWeb/Bindings/CSSNamespace.cpp
+++ b/Userland/Libraries/LibWeb/Bindings/CSSNamespace.cpp
@@ -38,11 +38,11 @@ JS_DEFINE_NATIVE_FUNCTION(CSSNamespace::escape)
return {};
}
- String result = Web::CSS::serialize_an_identifier(vm.argument(0).to_string(global_object));
+ auto identifier = vm.argument(0).to_string(global_object);
if (vm.exception())
return {};
- return JS::Value(JS::js_string(vm, result));
+ return JS::js_string(vm, Web::CSS::serialize_an_identifier(identifier));
}
// https://www.w3.org/TR/css-conditional-3/#dom-css-supports