Skip to content

Commit

Permalink
LibWeb: Handle JS exceptions slightly sooner in CSS.escape()
Browse files Browse the repository at this point in the history
  • Loading branch information
awesomekling committed Oct 10, 2021
1 parent 82da36f commit 4bf8843
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Userland/Libraries/LibWeb/Bindings/CSSNamespace.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 4bf8843

Please sign in to comment.