From 4458b7bf19463b7171d076ae243492298d3dc387 Mon Sep 17 00:00:00 2001 From: Linus Groh Date: Sat, 10 Dec 2022 00:05:57 +0000 Subject: [PATCH] LibJS: Add spec comments to unary_plus() --- Userland/Libraries/LibJS/Runtime/Value.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Userland/Libraries/LibJS/Runtime/Value.cpp b/Userland/Libraries/LibJS/Runtime/Value.cpp index e0572b5c45..2d34f6f14e 100644 --- a/Userland/Libraries/LibJS/Runtime/Value.cpp +++ b/Userland/Libraries/LibJS/Runtime/Value.cpp @@ -1445,8 +1445,13 @@ ThrowCompletionOr bitwise_not(VM& vm, Value lhs) } // 13.5.4 Unary + Operator, https://tc39.es/ecma262/#sec-unary-plus-operator +// UnaryExpression : + UnaryExpression ThrowCompletionOr 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)); }