1. Let _rref_ be ? Evaluation of |AssignmentExpression|.
1. Let _rval_ be ? GetValue(_rref_).
1. Let _assignmentOpText_ be the source text matched by |AssignmentOperator|.
- 1. Let _opText_ be the sequence of Unicode code points associated with _assignmentOpText_ in the following table:
-
-
-
-
_assignmentOpText_
_opText_
-
`**=`
`**`
-
`*=`
`*`
-
`/=`
`/`
-
`%=`
`%`
-
`+=`
`+`
-
`-=`
`-`
-
`<<=`
`<<`
-
`>>=`
`>>`
-
`>>>=`
`>>>`
-
`&=`
`&`
-
`^=`
`^`
-
`|=`
`|`
-
-
+ 1. Let _len_ be the number of code points in _assignmentOpText_.
+ 1. Assert: _len_ ≥ 2 and the last code point in _assignmentOpText_ is `=`.
+ 1. Let _opText_ be the sequence of the first _len_ - 1 code points of _assignmentOpText_.
1. Let _r_ be ? ApplyStringOrNumericBinaryOperator(_lval_, _opText_, _rval_).
1. [id="step-assignmentexpression-evaluation-compound-putvalue"] Perform ? PutValue(_lref_, _r_).
1. Return _r_.
@@ -20329,39 +20313,34 @@
1. Let _lnum_ be ? ToNumeric(_lval_).
1. Let _rnum_ be ? ToNumeric(_rval_).
1. If Type(_lnum_) is different from Type(_rnum_), throw a *TypeError* exception.
+ 1. NOTE: The following steps can only throw an exception if _lnum_ is a BigInt and _opText_ is one of `**`, `/`, `%`, or `>>>`.
+ 1. If _lnum_ is a Number, then
+ 1. If _opText_ is `**`, return Number::exponentiate(_lnum_, _rnum_).
+ 1. If _opText_ is `*`, return Number::multiply(_lnum_, _rnum_).
+ 1. If _opText_ is `/`, return Number::divide(_lnum_, _rnum_).
+ 1. If _opText_ is `%`, return Number::remainder(_lnum_, _rnum_).
+ 1. If _opText_ is `+`, return Number::add(_lnum_, _rnum_).
+ 1. If _opText_ is `-`, return Number::subtract(_lnum_, _rnum_).
+ 1. If _opText_ is `<<`, return Number::leftShift(_lnum_, _rnum_).
+ 1. If _opText_ is `>>`, return Number::signedRightShift(_lnum_, _rnum_).
+ 1. If _opText_ is `>>>`, return Number::unsignedRightShift(_lnum_, _rnum_).
+ 1. If _opText_ is `&`, return Number::bitwiseAND(_lnum_, _rnum_).
+ 1. If _opText_ is `^`, return Number::bitwiseXOR(_lnum_, _rnum_).
+ 1. If _opText_ is `|`, return Number::bitwiseOR(_lnum_, _rnum_).
1. If _lnum_ is a BigInt, then
1. If _opText_ is `**`, return ? BigInt::exponentiate(_lnum_, _rnum_).
+ 1. If _opText_ is `*`, return BigInt::multiply(_lnum_, _rnum_).
1. If _opText_ is `/`, return ? BigInt::divide(_lnum_, _rnum_).
1. If _opText_ is `%`, return ? BigInt::remainder(_lnum_, _rnum_).
+ 1. If _opText_ is `+`, return BigInt::add(_lnum_, _rnum_).
+ 1. If _opText_ is `-`, return BigInt::subtract(_lnum_, _rnum_).
+ 1. If _opText_ is `<<`, return BigInt::leftShift(_lnum_, _rnum_).
+ 1. If _opText_ is `>>`, return BigInt::signedRightShift(_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. Return _operation_(_lnum_, _rnum_).
+ 1. If _opText_ is `&`, return BigInt::bitwiseAND(_lnum_, _rnum_).
+ 1. If _opText_ is `^`, return BigInt::bitwiseXOR(_lnum_, _rnum_).
+ 1. If _opText_ is `|`, return BigInt::bitwiseOR(_lnum_, _rnum_).
+ 1. Assert: This step is not reached.
No hint is provided in the calls to ToPrimitive in steps and . All standard objects except Dates handle the absence of a hint as if ~number~ were given; Dates handle the absence of a hint as if ~string~ were given. Exotic objects may handle the absence of a hint in some other manner.