mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-11 02:29:21 +00:00
LibJS: Convert NativeFunction callback to ThrowCompletionOr
This commit is contained in:
parent
20163c0584
commit
ca27e5eff5
Notes:
sideshowbarker
2024-07-18 02:08:51 +09:00
Author: https://github.com/IdanHo
Commit: ca27e5eff5
Pull-request: https://github.com/SerenityOS/serenity/pull/10543
Reviewed-by: https://github.com/linusg
13 changed files with 91 additions and 65 deletions
|
@ -70,7 +70,7 @@ JS_DEFINE_OLD_NATIVE_FUNCTION(ProxyConstructor::revocable)
|
|||
return {};
|
||||
|
||||
// 28.2.2.1.1 Proxy Revocation Functions, https://tc39.es/ecma262/#sec-proxy-revocation-functions
|
||||
auto* revoker = NativeFunction::create(global_object, "", [proxy_handle = make_handle(proxy)](auto&, auto&) -> Value {
|
||||
auto* revoker = NativeFunction::create(global_object, "", [proxy_handle = make_handle(proxy)](auto&, auto&) -> ThrowCompletionOr<Value> {
|
||||
auto& proxy = const_cast<ProxyObject&>(*proxy_handle.cell());
|
||||
if (proxy.is_revoked())
|
||||
return js_undefined();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue