summaryrefslogtreecommitdiff
path: root/deps/v8/src/builtins/proxy-set-property.tq
diff options
context:
space:
mode:
Diffstat (limited to 'deps/v8/src/builtins/proxy-set-property.tq')
-rw-r--r--deps/v8/src/builtins/proxy-set-property.tq20
1 files changed, 13 insertions, 7 deletions
diff --git a/deps/v8/src/builtins/proxy-set-property.tq b/deps/v8/src/builtins/proxy-set-property.tq
index d0411a8e89..2d9636c881 100644
--- a/deps/v8/src/builtins/proxy-set-property.tq
+++ b/deps/v8/src/builtins/proxy-set-property.tq
@@ -19,15 +19,21 @@ namespace proxy {
// https://tc39.github.io/ecma262/#sec-proxy-object-internal-methods-and-internal-slots-set-p-v-receiver
transitioning builtin
ProxySetProperty(implicit context: Context)(
- proxy: JSProxy, name: Name, value: Object,
- receiverValue: Object): Object {
+ proxy: JSProxy, name: PropertyKey | PrivateSymbol, value: JSAny,
+ receiverValue: JSAny): JSAny {
// 1. Assert: IsPropertyKey(P) is true.
assert(TaggedIsNotSmi(name));
assert(IsName(name));
- if (IsPrivateSymbol(name)) {
- CallThrowTypeErrorIfStrict(kProxyPrivate);
- return Undefined;
+ let key: PropertyKey;
+ typeswitch (name) {
+ case (PrivateSymbol): {
+ CallThrowTypeErrorIfStrict(kProxyPrivate);
+ return Undefined;
+ }
+ case (name: PropertyKey): {
+ key = name;
+ }
}
try {
@@ -61,8 +67,8 @@ namespace proxy {
// exception.
// 12. Return true.
const trapResult =
- Call(context, trap, handler, target, name, value, receiverValue);
- if (BranchIfToBooleanIsTrue(trapResult)) {
+ Call(context, trap, handler, target, key, value, receiverValue);
+ if (ToBoolean(trapResult)) {
CheckGetSetTrapResult(target, proxy, name, value, kProxySet);
return value;
}