| bigint-and-number.js |
---
esid: sec-addition-operator-plus-runtime-semantics-evaluation
description: Mixing BigInt and Number produces a TypeError for addition operator
features: [BigInt]
info: |
Let lprim be ? ToPrimitive(lval).
Let rprim be ? ToPrimitive(rval).
...
Let lnum be ? ToNumeric(lprim)
Let rnum be ? ToNumeric(rprim)
If Type(lnum) does not equal Type(rnum), throw a TypeError exception.
--- |
2184 |
- |
| bigint-arithmetic.js |
---
esid: sec-addition-operator-plus-runtime-semantics-evaluation
description: BigInt addition arithmetic
features: [BigInt]
--- |
38000 |
- |
| bigint-errors.js |
---
description: addition operator ToNumeric with BigInt operands
esid: sec-addition-operator-plus-runtime-semantics-evaluation
features: [BigInt, Symbol, Symbol.toPrimitive, computed-property-names]
--- |
1937 |
- |
| bigint-toprimitive.js |
---
description: addition operator ToNumeric with BigInt operands
esid: sec-addition-operator-plus-runtime-semantics-evaluation
features: [BigInt, Symbol.toPrimitive, computed-property-names]
--- |
8778 |
- |
| bigint-wrapped-values.js |
---
description: addition operator ToNumeric with BigInt operands
esid: sec-addition-operator-plus-runtime-semantics-evaluation
features: [BigInt, Symbol.toPrimitive, computed-property-names]
--- |
1394 |
- |
| coerce-bigint-to-string.js |
---
description: ToString is applied BigInt values in an additive expression with another string
esid: prod-AdditiveExpression
info: |
AdditiveExpression: AdditiveExpression + MultiplicativeExpression
...
7. If Type(lprim) is String or Type(rprim) is String, then
a. Let lstr be ? ToString(lprim).
b. Let rstr be ? ToString(rprim).
c. Return the String that is the result of concatenating lstr and rstr.
...
ToString Applied to the BigInt Type
1. If i is less than zero, return the String concatenation of the String "-" and ToString(-i).
2. Return the String consisting of the code units of the digits of the decimal representation of i.
features: [BigInt]
--- |
1340 |
- |
| coerce-symbol-to-prim-err.js |
---
esid: sec-addition-operator-plus-runtime-semantics-evaluation
es6id: 12.7.3.1
description: >
Behavior when error thrown by invocation of `Symbol.toPrimitive` method
during coercion
info: |
[...]
5. Let lprim be ? ToPrimitive(lval).
6. Let rprim be ? ToPrimitive(rval).
[...]
ES6 Section 7.1.1 ToPrimitive ( input [, PreferredType] )
[...]
4. Let exoticToPrim be GetMethod(input, @@toPrimitive).
5. ReturnIfAbrupt(exoticToPrim).
6. If exoticToPrim is not undefined, then
a. Let result be Call(exoticToPrim, input, «hint»).
b. ReturnIfAbrupt(result).
features: [Symbol.toPrimitive]
--- |
1488 |
- |
| coerce-symbol-to-prim-invocation.js |
---
esid: sec-addition-operator-plus-runtime-semantics-evaluation
es6id: 12.7.3.1
description: Invocation of `Symbol.toPrimitive` method during coercion
info: |
[...]
5. Let lprim be ? ToPrimitive(lval).
6. Let rprim be ? ToPrimitive(rval).
[...]
ES6 Section 7.2.12 Abstract Equality Comparison
[...]
10. If Type(x) is either String, Number, or Symbol and Type(y) is Object,
then return the result of the comparison x == ToPrimitive(y).
ES6 Section 7.1.1 ToPrimitive ( input [, PreferredType] )
1. If PreferredType was not passed, let hint be "default".
[...]
4. Let exoticToPrim be GetMethod(input, @@toPrimitive).
5. ReturnIfAbrupt(exoticToPrim).
6. If exoticToPrim is not undefined, then
a. Let result be Call(exoticToPrim, input, «hint»).
[...]
features: [Symbol.toPrimitive]
--- |
1853 |
- |
| coerce-symbol-to-prim-return-obj.js |
---
esid: sec-addition-operator-plus-runtime-semantics-evaluation
es6id: 12.7.3.1
description: >
Behavior when coercion via `Symbol.toPrimitive` yields an Object
info: |
[...]
5. Let lprim be ? ToPrimitive(lval).
6. Let rprim be ? ToPrimitive(rval).
[...]
ES6 Section 7.1.1 ToPrimitive ( input [, PreferredType] )
[...]
4. Let exoticToPrim be GetMethod(input, @@toPrimitive).
5. ReturnIfAbrupt(exoticToPrim).
6. If exoticToPrim is not undefined, then
a. Let result be Call(exoticToPrim, input, «hint»).
b. ReturnIfAbrupt(result).
c. If Type(result) is not Object, return result.
d. Throw a TypeError exception.
features: [Symbol.toPrimitive]
--- |
1391 |
- |
| coerce-symbol-to-prim-return-prim.js |
---
esid: sec-addition-operator-plus-runtime-semantics-evaluation
es6id: 12.7.3.1
description: >
Behavior when coercion via `Symbol.toPrimitive` yields a primitive value
info: |
[...]
5. Let lprim be ? ToPrimitive(lval).
6. Let rprim be ? ToPrimitive(rval).
7. If Type(lprim) is String or Type(rprim) is String, then
a. Let lstr be ? ToString(lprim).
b. Let rstr be ? ToString(rprim).
c. Return the String that is the result of concatenating lstr and rstr.
8. Let lnum be ? ToNumber(lprim).
9. Let rnum be ? ToNumber(rprim).
10. Return the result of applying the addition operation to lnum and rnum.
See the Note below 12.8.5.
ES6 Section 7.1.1 ToPrimitive ( input [, PreferredType] )
[...]
4. Let exoticToPrim be GetMethod(input, @@toPrimitive).
5. ReturnIfAbrupt(exoticToPrim).
6. If exoticToPrim is not undefined, then
a. Let result be Call(exoticToPrim, input, «hint»).
b. ReturnIfAbrupt(result).
c. If Type(result) is not Object, return result.
features: [Symbol.toPrimitive]
--- |
1992 |
- |
| get-symbol-to-prim-err.js |
---
esid: sec-addition-operator-plus-runtime-semantics-evaluation
es6id: 12.7.3.1
description: >
Behavior when error is thrown while accessing `Symbol.toPrimitive` property
info: |
[...]
5. Let lprim be ? ToPrimitive(lval).
6. Let rprim be ? ToPrimitive(rval).
[...]
ES6 Section 7.1.1 ToPrimitive ( input [, PreferredType] )
1. If PreferredType was not passed, let hint be "default".
[...]
4. Let exoticToPrim be GetMethod(input, @@toPrimitive).
5. ReturnIfAbrupt(exoticToPrim).
6. If exoticToPrim is not undefined, then
a. Let result be Call(exoticToPrim, input, «hint»).
[...]
features: [Symbol.toPrimitive]
--- |
1382 |
- |
| order-of-evaluation.js |
---
esid: sec-addition-operator-plus-runtime-semantics-evaluation
description: Type coercion order of operations for addition operator
features: [Symbol]
info: |
Evaluate lhs
Evaluate rhs
ToPrimitive(lhs)
ToPrimitive(rhs)
ToNumeric(lhs)
ToNumeric(rhs)
--- |
3099 |
- |
| S11.6.1_A1.js |
---
info: |
White Space and Line Terminator between AdditiveExpression and "+" or
between "+" and MultiplicativeExpression are allowed
es5id: 11.6.1_A1
description: Checking by using eval
--- |
1621 |
- |
| S11.6.1_A2.1_T1.js |
---
info: Operator x + y uses GetValue
es5id: 11.6.1_A2.1_T1
description: Either Type is not Reference or GetBase is not null
--- |
1090 |
- |
| S11.6.1_A2.1_T2.js |
---
info: Operator x + y uses GetValue
es5id: 11.6.1_A2.1_T2
description: If GetBase(x) is null, throw ReferenceError
--- |
519 |
- |
| S11.6.1_A2.1_T3.js |
---
info: Operator x + y uses GetValue
es5id: 11.6.1_A2.1_T3
description: If GetBase(y) is null, throw ReferenceError
--- |
519 |
- |
| S11.6.1_A2.2_T1.js |
---
info: Operator x + y uses [[Default Value]]
es5id: 11.6.1_A2.2_T1
description: If Type(value) is Object, evaluate ToPrimitive(value, Number)
--- |
3192 |
- |
| S11.6.1_A2.2_T2.js |
---
info: Operator x + y uses [[Default Value]]
es5id: 11.6.1_A2.2_T2
description: If Type(value) is Date object, evaluate ToPrimitive(value, String)
--- |
1184 |
- |
| S11.6.1_A2.2_T3.js |
---
info: Operator x + y uses [[Default Value]]
es5id: 11.6.1_A2.2_T3
description: If Type(value) is Function, evaluate ToPrimitive(value, Number)
--- |
1254 |
- |
| S11.6.1_A2.3_T1.js |
---
info: |
ToNumber(first expression) is called first, and then ToNumber(second
expression)
es5id: 11.6.1_A2.3_T1
description: Checking with "throw"
--- |
965 |
- |
| S11.6.1_A2.4_T1.js |
---
info: First expression is evaluated first, and then second expression
es5id: 11.6.1_A2.4_T1
description: Checking with "="
--- |
544 |
- |
| S11.6.1_A2.4_T2.js |
---
info: First expression is evaluated first, and then second expression
es5id: 11.6.1_A2.4_T2
description: Checking with "throw"
--- |
859 |
- |
| S11.6.1_A2.4_T3.js |
---
info: First expression is evaluated first, and then second expression
es5id: 11.6.1_A2.4_T3
description: Checking with undeclarated variables
--- |
571 |
- |
| S11.6.1_A2.4_T4.js |
---
info: First expression is evaluated first, and then second expression
es5id: 11.6.1_A2.4_T4
description: Checking with undeclarated variables
flags: [noStrict]
--- |
420 |
- |
| S11.6.1_A3.1_T1.1.js |
---
info: |
If Type(Primitive(x)) is not String and Type(Primitive(y)) is not String,
then operator x + y returns ToNumber(x) + ToNumber(y)
es5id: 11.6.1_A3.1_T1.1
description: >
Type(Primitive(x)) and Type(Primitive(y)) vary between primitive
boolean and Boolean object
--- |
1044 |
- |
| S11.6.1_A3.1_T1.2.js |
---
info: |
If Type(Primitive(x)) is not String and Type(Primitive(y)) is not String,
then operator x + y returns ToNumber(x) + ToNumber(y)
es5id: 11.6.1_A3.1_T1.2
description: >
Type(Primitive(x)) and Type(Primitive(y)) vary between primitive
number and Number object
--- |
958 |
- |
| S11.6.1_A3.1_T1.3.js |
---
info: |
If Type(Primitive(x)) is not String and Type(Primitive(y)) is not String,
then operator x + y returns ToNumber(x) + ToNumber(y)
es5id: 11.6.1_A3.1_T1.3
description: >
Type(Primitive(x)) and Type(Primitive(y)) vary between Null and
Undefined
--- |
993 |
- |
| S11.6.1_A3.1_T2.1.js |
---
info: |
If Type(Primitive(x)) is not String and Type(Primitive(y)) is not String,
then operator x + y returns ToNumber(x) + ToNumber(y)
es5id: 11.6.1_A3.1_T2.1
description: >
Type(Primitive(x)) is different from Type(Primitive(y)) and both
types vary between Number (primitive or object) or Boolean
(primitive and object)
--- |
1635 |
- |
| S11.6.1_A3.1_T2.2.js |
---
info: |
If Type(Primitive(x)) is not String and Type(Primitive(y)) is not String,
then operator x + y returns ToNumber(x) + ToNumber(y)
es5id: 11.6.1_A3.1_T2.2
description: >
Type(Primitive(x)) is different from Type(Primitive(y)) and both
types vary between Number (primitive or object) and Null
--- |
954 |
- |
| S11.6.1_A3.1_T2.3.js |
---
info: |
If Type(Primitive(x)) is not String and Type(Primitive(y)) is not String,
then operator x + y returns ToNumber(x) + ToNumber(y)
es5id: 11.6.1_A3.1_T2.3
description: >
Type(Primitive(x)) is different from Type(Primitive(y)) and both
types vary between Number (primitive or object) and Undefined
--- |
1103 |
- |
| S11.6.1_A3.1_T2.4.js |
---
info: |
If Type(Primitive(x)) is not String and Type(Primitive(y)) is not String,
then operator x + y returns ToNumber(x) + ToNumber(y)
es5id: 11.6.1_A3.1_T2.4
description: >
Type(Primitive(x)) is different from Type(Primitive(y)) and both
types vary between Boolean (primitive or object) and Undefined
--- |
1146 |
- |
| S11.6.1_A3.1_T2.5.js |
---
info: |
If Type(Primitive(x)) is not String and Type(Primitive(y)) is not String,
then operator x + y returns ToNumber(x) + ToNumber(y)
es5id: 11.6.1_A3.1_T2.5
description: >
Type(Primitive(x)) is different from Type(Primitive(y)) and both
types vary between Boolean (primitive or object) and Null
--- |
997 |
- |
| S11.6.1_A3.2_T1.1.js |
---
info: |
If Type(Primitive(x)) is String or Type(Primitive(y)) is String, then
operator x + y returns the result of concatenating ToString(x) followed
by ToString(y)
es5id: 11.6.1_A3.2_T1.1
description: >
Type(Primitive(x)) and Type(Primitive(y)) vary between primitive
string and String object
--- |
1292 |
- |
| S11.6.1_A3.2_T1.2.js |
---
info: |
If Type(Primitive(x)) is String or Type(Primitive(y)) is String, then
operator x + y returns the result of concatenating ToString(x) followed
by ToString(y)
es5id: 11.6.1_A3.2_T1.2
description: >
Type(Primitive(x)) and Type(Primitive(y)) vary between Object
object and Function object
--- |
1494 |
- |
| S11.6.1_A3.2_T2.1.js |
---
info: |
If Type(Primitive(x)) is String or Type(Primitive(y)) is String, then
operator x + y returns the result of concatenating ToString(x) followed
by ToString(y)
es5id: 11.6.1_A3.2_T2.1
description: >
Type(Primitive(x)) is different from Type(Primitive(y)) and both
types vary between Number (primitive or object) and String
(primitive and object)
--- |
1899 |
- |
| S11.6.1_A3.2_T2.2.js |
---
info: |
If Type(Primitive(x)) is String or Type(Primitive(y)) is String, then
operator x + y returns the result of concatenating ToString(x) followed
by ToString(y)
es5id: 11.6.1_A3.2_T2.2
description: >
Type(Primitive(x)) is different from Type(Primitive(y)) and both
types vary between String (primitive or object) and Boolean
(primitive and object)
--- |
1813 |
- |
| S11.6.1_A3.2_T2.3.js |
---
info: |
If Type(Primitive(x)) is String or Type(Primitive(y)) is String, then
operator x + y returns the result of concatenating ToString(x) followed
by ToString(y)
es5id: 11.6.1_A3.2_T2.3
description: >
Type(Primitive(x)) is different from Type(Primitive(y)) and both
types vary between String (primitive or object) and Undefined
--- |
1164 |
- |
| S11.6.1_A3.2_T2.4.js |
---
info: |
If Type(Primitive(x)) is String or Type(Primitive(y)) is String, then
operator x + y returns the result of concatenating ToString(x) followed
by ToString(y)
es5id: 11.6.1_A3.2_T2.4
description: >
Type(Primitive(x)) is different from Type(Primitive(y)) and both
types vary between String (primitive or object) and Null
--- |
1059 |
- |
| S11.6.1_A4_T1.js |
---
info: |
The result of an addition is determined using the rules of IEEE 754
double-precision arithmetics
es5id: 11.6.1_A4_T1
description: If either operand is NaN, the result is NaN
--- |
1275 |
- |
| S11.6.1_A4_T2.js |
---
info: |
The result of an addition is determined using the rules of IEEE 754
double-precision arithmetics
es5id: 11.6.1_A4_T2
description: The sum of two infinities of opposite sign is NaN
--- |
731 |
- |
| S11.6.1_A4_T3.js |
---
info: |
The result of an addition is determined using the rules of IEEE 754
double-precision arithmetics
es5id: 11.6.1_A4_T3
description: >
The sum of two infinities of the same sign is the infinity of that
sign
--- |
782 |
- |
| S11.6.1_A4_T4.js |
---
info: |
The result of an addition is determined using the rules of IEEE 754
double-precision arithmetics
es5id: 11.6.1_A4_T4
description: >
The sum of an infinity and a finite value is equal to the infinite
operand
--- |
1900 |
- |
| S11.6.1_A4_T5.js |
---
info: |
The result of an addition is determined using the rules of IEEE 754
double-precision arithmetics
es5id: 11.6.1_A4_T5
description: >
The sum of two negative zeros is -0. The sum of two positive
zeros, or of two zeros of opposite sign is +0
--- |
1341 |
- |
| S11.6.1_A4_T6.js |
---
info: |
The result of an addition is determined using the rules of IEEE 754
double-precision arithmetics
es5id: 11.6.1_A4_T6
description: >
The sum of a zero and a nonzero finite value is equal to the
nonzero operand
--- |
1493 |
- |
| S11.6.1_A4_T7.js |
---
info: |
The result of an addition is determined using the rules of IEEE 754
double-precision arithmetics
es5id: 11.6.1_A4_T7
description: >
The sum of two nonzero finite values of the same magnitude and
opposite sign is +0
--- |
1573 |
- |
| S11.6.1_A4_T8.js |
---
info: |
The result of an addition is determined using the rules of IEEE 754
double-precision arithmetics
es5id: 11.6.1_A4_T8
description: >
If the magnitude is too large to represent, the operation
overflows and the result is then an infinity of appropriate sign
--- |
1260 |
- |
| S11.6.1_A4_T9.js |
---
info: |
The result of an addition is determined using the rules of IEEE 754
double-precision arithmetics
es5id: 11.6.1_A4_T9
description: >
The addition operator is not always associative ( x + y + z is the
same (x + y) + z, not x + (y + z))
--- |
1385 |
- |
| symbol-to-string.js |
---
esid: sec-addition-operator-plus
es6id: 12.7.3
description: Symbol value cannot be converted to a String
info: |
[...]
7. If Type(lprim) is String or Type(rprim) is String, then
a. Let lstr be ? ToString(lprim).
features: [Symbol]
--- |
471 |
- |