mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 02:17:34 +00:00
LibWeb: Convert Node to use TRY for error propagation
This commit is contained in:
parent
07a2c58da0
commit
3861396fe4
1 changed files with 2 additions and 4 deletions
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2018-2022, Andreas Kling <kling@serenityos.org>
|
* Copyright (c) 2018-2022, Andreas Kling <kling@serenityos.org>
|
||||||
* Copyright (c) 2021, Linus Groh <linusg@serenityos.org>
|
* Copyright (c) 2021-2022, Linus Groh <linusg@serenityos.org>
|
||||||
* Copyright (c) 2021, Luke Wilde <lukew@serenityos.org>
|
* Copyright (c) 2021, Luke Wilde <lukew@serenityos.org>
|
||||||
*
|
*
|
||||||
* SPDX-License-Identifier: BSD-2-Clause
|
* SPDX-License-Identifier: BSD-2-Clause
|
||||||
|
@ -368,9 +368,7 @@ void Node::insert_before(NonnullRefPtr<Node> node, RefPtr<Node> child, bool supp
|
||||||
// https://dom.spec.whatwg.org/#concept-node-pre-insert
|
// https://dom.spec.whatwg.org/#concept-node-pre-insert
|
||||||
ExceptionOr<NonnullRefPtr<Node>> Node::pre_insert(NonnullRefPtr<Node> node, RefPtr<Node> child)
|
ExceptionOr<NonnullRefPtr<Node>> Node::pre_insert(NonnullRefPtr<Node> node, RefPtr<Node> child)
|
||||||
{
|
{
|
||||||
auto validity_result = ensure_pre_insertion_validity(node, child);
|
TRY(ensure_pre_insertion_validity(node, child));
|
||||||
if (validity_result.is_exception())
|
|
||||||
return validity_result.exception();
|
|
||||||
|
|
||||||
auto reference_child = child;
|
auto reference_child = child;
|
||||||
if (reference_child == node)
|
if (reference_child == node)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue