1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 00:17:46 +00:00

LibJS: Add spec comments to unary_plus()

This commit is contained in:
Linus Groh 2022-12-10 00:05:57 +00:00
parent c23d8c7486
commit 4458b7bf19

View file

@ -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
// UnaryExpression : + UnaryExpression
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));
}