2.1.51 [ECMA-262/9:2018] Section 22.1.3.18 Array.prototype.push ( ...items )
V0204: Array.prototype.push does not throw TypeError on length overflow
The specification states:
-
22.1.3.18 Array.prototype.push ( ...items ) ... When the push method is called with zero or more arguments the following steps are taken: 1. Let O be ? ToObject(this value). 2. Let len be ? ToLength(? Get(O, "length")). 3. Let items be a List whose elements are, in left to right order, the arguments that were passed to this function invocation. 4. Let argCount be the number of elements in items. 5. If len + argCount > 2^53-1, throw a TypeError exception.
EdgeHTML Mode
The following step is not executed:
5. If len + argCount > 2^53-1, throw a TypeError exception.
As a result, Array.prototype.push
does not throw TypeError on length overflow.