From 19a1b8f385848284996223f5938f2851fd018d1b Mon Sep 17 00:00:00 2001 From: Jordan Harband Date: Thu, 5 Sep 2024 22:52:41 -0700 Subject: [PATCH] Editorial: `ApplyStringOrNumericBinaryOperator`: refactor into two explicit tables (#3420) --- spec.html | 73 +++++++++++++++++++++++++++++++++---------------------- 1 file changed, 44 insertions(+), 29 deletions(-) diff --git a/spec.html b/spec.html index 07e21a380d..5070d0a48a 100644 --- a/spec.html +++ b/spec.html @@ -20688,35 +20688,50 @@

1. If _opText_ is `/`, return ? BigInt::divide(_lNum_, _rNum_). 1. If _opText_ is `%`, return ? BigInt::remainder(_lNum_, _rNum_). 1. If _opText_ is `>>>`, return ? BigInt::unsignedRightShift(_lNum_, _rNum_). - 1. Let _operation_ be the abstract operation associated with _opText_ and Type(_lNum_) in the following table: -
- - - - - - - - - - - - - - - - - - - - - - - - - -
_opText_ Type(_lNum_) _operation_
`**` Number Number::exponentiate
`*` Number Number::multiply
`*` BigInt BigInt::multiply
`/` Number Number::divide
`%` Number Number::remainder
`+` Number Number::add
`+` BigInt BigInt::add
`-` Number Number::subtract
`-` BigInt BigInt::subtract
`<<` Number Number::leftShift
`<<` BigInt BigInt::leftShift
`>>` Number Number::signedRightShift
`>>` BigInt BigInt::signedRightShift
`>>>` Number Number::unsignedRightShift
`&` Number Number::bitwiseAND
`&` BigInt BigInt::bitwiseAND
`^` Number Number::bitwiseXOR
`^` BigInt BigInt::bitwiseXOR
`|` Number Number::bitwiseOR
`|` BigInt BigInt::bitwiseOR
-
+ 1. Let _operation_ be the abstract operation associated with _opText_ in the following table: +
+ + + + + + + + + + + + + + + +
_opText_ _operation_
`*` BigInt::multiply
`+` BigInt::add
`-` BigInt::subtract
`<<` BigInt::leftShift
`>>` BigInt::signedRightShift
`&` BigInt::bitwiseAND
`^` BigInt::bitwiseXOR
`|` BigInt::bitwiseOR
+
+ 1. Else, + 1. Assert: _lNum_ is a Number. + 1. Let _operation_ be the abstract operation associated with _opText_ in the following table: +
+ + + + + + + + + + + + + + + + + + + +
_opText_ _operation_
`**` Number::exponentiate
`*` Number::multiply
`/` Number::divide
`%` Number::remainder
`+` Number::add
`-` Number::subtract
`<<` Number::leftShift
`>>` Number::signedRightShift
`>>>` Number::unsignedRightShift
`&` Number::bitwiseAND
`^` Number::bitwiseXOR
`|` Number::bitwiseOR
+
1. Return _operation_(_lNum_, _rNum_).