mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 00:07:36 +00:00
LibJS: Add spec comments to unary_plus()
This commit is contained in:
parent
c23d8c7486
commit
4458b7bf19
1 changed files with 5 additions and 0 deletions
|
@ -1445,8 +1445,13 @@ ThrowCompletionOr<Value> bitwise_not(VM& vm, Value lhs)
|
||||||
}
|
}
|
||||||
|
|
||||||
// 13.5.4 Unary + Operator, https://tc39.es/ecma262/#sec-unary-plus-operator
|
// 13.5.4 Unary + Operator, https://tc39.es/ecma262/#sec-unary-plus-operator
|
||||||
|
// UnaryExpression : + UnaryExpression
|
||||||
ThrowCompletionOr<Value> unary_plus(VM& vm, Value lhs)
|
ThrowCompletionOr<Value> unary_plus(VM& vm, Value lhs)
|
||||||
{
|
{
|
||||||
|
// 1. Let expr be ? Evaluation of UnaryExpression.
|
||||||
|
// NOTE: This is handled in the AST or Bytecode interpreter.
|
||||||
|
|
||||||
|
// 2. Return ? ToNumber(? GetValue(expr)).
|
||||||
return TRY(lhs.to_number(vm));
|
return TRY(lhs.to_number(vm));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue