mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 23:07:35 +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
|
@ -25,7 +25,7 @@ WebIDL::ExceptionOr<JS::NonnullGCPtr<TransformStream>> TransformStream::construc
|
|||
auto stream = realm.heap().allocate<TransformStream>(realm, realm);
|
||||
|
||||
// 1. If transformer is missing, set it to null.
|
||||
auto transformer = transformer_object.has_value() ? JS::Value { transformer_object.value().ptr() } : JS::js_null();
|
||||
auto transformer = transformer_object.has_value() ? JS::Value { transformer_object.value() } : JS::js_null();
|
||||
|
||||
// 2. Let transformerDict be transformer, converted to an IDL value of type Transformer.
|
||||
auto transformer_dict = TRY(Transformer::from_value(vm, transformer));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue