mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-10 03:26:10 +00:00
LibWeb: Port CSS/Serialize.{h,cpp} to new Strings, and propagate errors
This commit is contained in:
parent
a0b1eddc56
commit
85f3de6331
Notes:
sideshowbarker
2024-07-17 14:33:07 +09:00
Author: https://github.com/AtkinsSJ
Commit: 85f3de6331
Pull-request: https://github.com/SerenityOS/serenity/pull/17478
Reviewed-by: https://github.com/trflynn89 ✅
10 changed files with 108 additions and 99 deletions
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2021, Sam Atkins <atkinssj@serenityos.org>
|
||||
* Copyright (c) 2021-2023, Sam Atkins <atkinssj@serenityos.org>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
@ -34,8 +34,8 @@ JS_DEFINE_NATIVE_FUNCTION(CSSNamespace::escape)
|
|||
if (!vm.argument_count())
|
||||
return vm.throw_completion<JS::TypeError>(JS::ErrorType::BadArgCountAtLeastOne, "CSS.escape");
|
||||
|
||||
auto identifier = TRY(vm.argument(0).to_deprecated_string(vm));
|
||||
return JS::PrimitiveString::create(vm, Web::CSS::serialize_an_identifier(identifier));
|
||||
auto identifier = TRY(vm.argument(0).to_string(vm));
|
||||
return JS::PrimitiveString::create(vm, TRY_OR_THROW_OOM(vm, Web::CSS::serialize_an_identifier(identifier)));
|
||||
}
|
||||
|
||||
// https://www.w3.org/TR/css-conditional-3/#dom-css-supports
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue