1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 14:27:35 +00:00

LibWeb: Handle JS exceptions slightly sooner in CSS.escape()

This commit is contained in:
Andreas Kling 2021-10-10 02:55:19 +02:00
parent 82da36f129
commit 4bf88436cb

View file

@ -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