mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-16 05:51:55 +00:00
LibJS: Add and use ValidateNonRevokedProxy AO
This refactor is from two editorial changes to the spec from a while back.44d1cae2b2
21ffeee869
This commit is contained in:
parent
e48645c83f
commit
9bae24cc4a
Notes:
github-actions[bot]
2025-04-24 08:38:42 +00:00
Author: https://github.com/ADKaster
Commit: 9bae24cc4a
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/4437
4 changed files with 107 additions and 122 deletions
|
@ -233,18 +233,16 @@ ThrowCompletionOr<bool> Value::is_array(VM& vm) const
|
|||
return true;
|
||||
|
||||
// 3. If argument is a Proxy exotic object, then
|
||||
if (is<ProxyObject>(object)) {
|
||||
auto const& proxy = static_cast<ProxyObject const&>(object);
|
||||
if (auto const* proxy = as_if<ProxyObject>(object)) {
|
||||
|
||||
// a. If argument.[[ProxyHandler]] is null, throw a TypeError exception.
|
||||
if (proxy.is_revoked())
|
||||
return vm.throw_completion<TypeError>(ErrorType::ProxyRevoked);
|
||||
// a. Perform ? ValidateNonRevokedProxy(argument).
|
||||
TRY(proxy->validate_non_revoked_proxy());
|
||||
|
||||
// b. Let target be argument.[[ProxyTarget]].
|
||||
auto const& target = proxy.target();
|
||||
// b. Let proxyTarget be argument.[[ProxyTarget]].
|
||||
auto& proxy_target = proxy->target();
|
||||
|
||||
// c. Return ? IsArray(target).
|
||||
return Value(&target).is_array(vm);
|
||||
// c. Return ? IsArray(proxyTarget).
|
||||
return Value(&proxy_target).is_array(vm);
|
||||
}
|
||||
|
||||
// 4. Return false.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue