mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 18:17:45 +00:00
LibJS+LibWeb: Add JS::Value constructor for `JS::Handle<T>
`
Similar to the constructors for ``JS::{Nonnull}GCPtr<T>``, this helper avoids unnecessary .ptr() clutter when we want to construct Values.
This commit is contained in:
parent
9624eca116
commit
d361221657
8 changed files with 13 additions and 7 deletions
|
@ -1707,7 +1707,7 @@ static void generate_wrap_statement(SourceGenerator& generator, ByteString const
|
|||
)~~~");
|
||||
} else if (type.name() == "ArrayBufferView" || type.name() == "BufferSource") {
|
||||
scoped_generator.append(R"~~~(
|
||||
@result_expression@ JS::Value(const_cast<JS::Object*>(@value@->raw_object().ptr()));
|
||||
@result_expression@ JS::Value(@value@->raw_object());
|
||||
)~~~");
|
||||
} else if (is<IDL::UnionType>(type)) {
|
||||
auto& union_type = verify_cast<IDL::UnionType>(type);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue