allocation-limit.js |
---
esid: sec-arraybuffer-length
description: >
Throws a RangeError if requested Data Block is too large.
info: |
ArrayBuffer( length )
...
6. Return AllocateArrayBuffer(NewTarget, byteLength).
6.2.6.1 CreateByteDataBlock(size)
...
2. Let db be a new Data Block value consisting of size bytes. If it is
impossible to create such a Data Block, throw a RangeError exception.
...
--- |
1010 |
browser.js |
|
0 |
data-allocation-after-object-creation.js |
---
esid: sec-arraybuffer-length
description: >
The new ArrayBuffer instance is created prior to allocating the Data Block.
info: |
ArrayBuffer( length )
...
6. Return AllocateArrayBuffer(NewTarget, byteLength).
AllocateArrayBuffer( constructor, byteLength )
1. Let obj be OrdinaryCreateFromConstructor(constructor, "%ArrayBufferPrototype%",
«[[ArrayBufferData]], [[ArrayBufferByteLength]]» ).
2. ReturnIfAbrupt(obj).
...
4. Let block be CreateByteDataBlock(byteLength).
5. ReturnIfAbrupt(block).
...
features: [Reflect.construct]
--- |
1118 |
init-zero.js |
---
esid: sec-arraybuffer-length
description: All bytes are initialized to zero
info: |
[...]
5. Return ? AllocateArrayBuffer(NewTarget, byteLength).
24.1.1.1 AllocateArrayBuffer
3. Let block be ? CreateByteDataBlock(byteLength).
6.2.6.1 CreateByteDataBlock
1. Assert: size≥0.
2. Let db be a new Data Block value consisting of size bytes. If it is
impossible to create such a Data Block, throw a RangeError exception.
3. Set all of the bytes of db to 0.
4. Return db.
features: [DataView]
--- |
1204 |
is-a-constructor.js |
---
esid: sec-ecmascript-standard-built-in-objects
description: >
The ArrayBuffer constructor implements [[Construct]]
info: |
IsConstructor ( argument )
The abstract operation IsConstructor takes argument argument (an ECMAScript language value).
It determines if argument is a function object with a [[Construct]] internal method.
It performs the following steps when called:
If Type(argument) is not Object, return false.
If argument has a [[Construct]] internal method, return true.
Return false.
includes: [isConstructor.js]
features: [Reflect.construct, ArrayBuffer]
--- |
871 |
isView |
|
|
length-is-absent.js |
---
esid: sec-arraybuffer-length
description: >
Returns an empty instance if length is absent
info: |
ArrayBuffer( length )
1. If NewTarget is undefined, throw a TypeError exception.
2. Let byteLength be ? ToIndex(length).
3. Return ? AllocateArrayBuffer(NewTarget, byteLength).
--- |
533 |
length-is-too-large-throws.js |
---
esid: sec-arraybuffer-length
description: >
Throws a RangeError if length >= 2 ** 53
info: |
ArrayBuffer( length )
1. If NewTarget is undefined, throw a TypeError exception.
2. Let byteLength be ? ToIndex(length).
ToIndex( value )
1. If value is undefined, then
a. Let index be 0.
2. Else,
a. Let integerIndex be ? ToInteger(value).
b. If integerIndex < 0, throw a RangeError exception.
...
--- |
859 |
length.js |
---
esid: sec-arraybuffer-constructor
description: >
ArrayBuffer.length is 1.
info: |
ArrayBuffer ( length )
ECMAScript Standard Built-in Objects:
Every built-in function object, including constructors, has a length
property whose value is an integer. Unless otherwise specified, this
value is equal to the largest number of named arguments shown in the
subclause headings for the function description. Optional parameters
(which are indicated with brackets: [ ]) or rest parameters (which
are shown using the form «...name») are not included in the default
argument count.
Unless otherwise specified, the length property of a built-in function
object has the attributes { [[Writable]]: false, [[Enumerable]]: false,
[[Configurable]]: true }.
includes: [propertyHelper.js]
features: [ArrayBuffer]
--- |
1106 |
name.js |
---
esid: sec-arraybuffer-constructor
description: >
ArrayBuffer.name is "ArrayBuffer".
info: |
17 ECMAScript Standard Built-in Objects:
Every built-in Function object, including constructors, that is not
identified as an anonymous function has a name property whose value is a
String.
Unless otherwise specified, the name property of a built-in Function object,
if it exists, has the attributes { [[Writable]]: false, [[Enumerable]]:
false, [[Configurable]]: true }.
includes: [propertyHelper.js]
--- |
833 |
negative-length-throws.js |
---
esid: sec-arraybuffer-length
description: >
Throws a Range Error if length represents an integer < 0
info: |
ArrayBuffer( length )
1. If NewTarget is undefined, throw a TypeError exception.
2. Let byteLength be ? ToIndex(length).
ToIndex( value )
1. If value is undefined, then
a. Let index be 0.
2. Else,
a. Let integerIndex be ? ToInteger(value).
b. If integerIndex < 0, throw a RangeError exception.
...
--- |
821 |
newtarget-prototype-is-not-object.js |
---
esid: sec-arraybuffer-length
description: >
[[Prototype]] defaults to %ArrayBufferPrototype% if NewTarget.prototype is not an object.
info: |
ArrayBuffer( length )
ArrayBuffer called with argument length performs the following steps:
...
6. Return AllocateArrayBuffer(NewTarget, byteLength).
AllocateArrayBuffer( constructor, byteLength )
1. Let obj be OrdinaryCreateFromConstructor(constructor, "%ArrayBufferPrototype%",
«[[ArrayBufferData]], [[ArrayBufferByteLength]]» ).
2. ReturnIfAbrupt(obj).
...
features: [Reflect.construct, Symbol]
--- |
2010 |
options-maxbytelength-allocation-limit.js |
---
esid: sec-arraybuffer-length
description: >
Throws a RangeError if the requested Data Block is too large.
info: |
ArrayBuffer ( length [ , options ] )
...
4. Return ? AllocateArrayBuffer(NewTarget, byteLength, requestedMaxByteLength).
AllocateArrayBuffer ( constructor, byteLength [ , maxByteLength ] )
...
5. Let block be ? CreateByteDataBlock(byteLength).
...
CreateByteDataBlock ( size )
...
2. Let db be a new Data Block value consisting of size bytes. If it is
impossible to create such a Data Block, throw a RangeError exception.
...
features: [resizable-arraybuffer]
--- |
1459 |
options-maxbytelength-compared-before-object-creation.js |
---
esid: sec-arraybuffer-length
description: >
The byteLength argument is validated before OrdinaryCreateFromConstructor.
info: |
ArrayBuffer ( length [ , options ] )
...
4. Return ? AllocateArrayBuffer(NewTarget, byteLength, requestedMaxByteLength).
AllocateArrayBuffer ( constructor, byteLength [ , maxByteLength ] )
...
3. If allocatingResizableBuffer is true, then
a. If byteLength > maxByteLength, throw a RangeError exception.
...
4. Let obj be ? OrdinaryCreateFromConstructor(constructor, "%ArrayBuffer.prototype%", slots).
...
features: [resizable-arraybuffer, Reflect.construct]
--- |
1369 |
options-maxbytelength-data-allocation-after-object-creation.js |
---
esid: sec-arraybuffer-length
description: >
The new ArrayBuffer instance is created prior to allocating the Data Block.
info: |
ArrayBuffer ( length [ , options ] )
...
4. Return ? AllocateArrayBuffer(NewTarget, byteLength, requestedMaxByteLength).
AllocateArrayBuffer ( constructor, byteLength [ , maxByteLength ] )
...
4. Let obj be ? OrdinaryCreateFromConstructor(constructor, "%ArrayBuffer.prototype%", slots).
5. Let block be ? CreateByteDataBlock(byteLength).
...
features: [resizable-arraybuffer, Reflect.construct]
--- |
1331 |
options-maxbytelength-diminuitive.js |
---
esid: sec-arraybuffer-constructor
description: |
Invoked with an options object whose `maxByteLength` property is less than
the length.
info: |
ArrayBuffer( length [ , options ] )
1. If NewTarget is undefined, throw a TypeError exception.
2. Let byteLength be ? ToIndex(length).
3. Let requestedMaxByteLength be ? GetArrayBufferMaxByteLengthOption(options).
4. If requestedMaxByteLength is empty, then
a. [...]
5. If byteLength > requestedMaxByteLength, throw a RangeError exception.
features: [resizable-arraybuffer]
--- |
994 |
options-maxbytelength-excessive.js |
---
esid: sec-arraybuffer-constructor
description: |
Invoked with an options object whose `maxByteLength` property exceeds the
maximum length value
info: |
ArrayBuffer( length [ , options ] )
1. If NewTarget is undefined, throw a TypeError exception.
2. Let byteLength be ? ToIndex(length).
3. Let requestedMaxByteLength be ? GetArrayBufferMaxByteLengthOption(options).
[...]
1.1.5 GetArrayBufferMaxByteLengthOption ( options )
1. If Type(options) is not Object, return empty.
2. Let maxByteLength be ? Get(options, "maxByteLength").
3. If maxByteLength is undefined, return empty.
4. Return ? ToIndex(maxByteLength).
features: [resizable-arraybuffer]
--- |
1186 |
options-maxbytelength-negative.js |
---
esid: sec-arraybuffer-constructor
description: Invoked with an options object whose `maxByteLength` property is negative
info: |
ArrayBuffer( length [ , options ] )
1. If NewTarget is undefined, throw a TypeError exception.
2. Let byteLength be ? ToIndex(length).
3. Let requestedMaxByteLength be ? GetArrayBufferMaxByteLengthOption(options).
[...]
1.1.5 GetArrayBufferMaxByteLengthOption ( options )
1. If Type(options) is not Object, return empty.
2. Let maxByteLength be ? Get(options, "maxByteLength").
3. If maxByteLength is undefined, return empty.
4. Return ? ToIndex(maxByteLength).
features: [resizable-arraybuffer]
--- |
1105 |
options-maxbytelength-object.js |
---
esid: sec-arraybuffer-constructor
description: |
Invoked with an options object whose `maxByteLength` property cannot be
coerced to a primitive value
info: |
ArrayBuffer( length [ , options ] )
1. If NewTarget is undefined, throw a TypeError exception.
2. Let byteLength be ? ToIndex(length).
3. Let requestedMaxByteLength be ? GetArrayBufferMaxByteLengthOption(options).
[...]
1.1.5 GetArrayBufferMaxByteLengthOption ( options )
1. If Type(options) is not Object, return empty.
2. Let maxByteLength be ? Get(options, "maxByteLength").
3. If maxByteLength is undefined, return empty.
4. Return ? ToIndex(maxByteLength).
features: [resizable-arraybuffer]
--- |
1444 |
options-maxbytelength-poisoned.js |
---
esid: sec-arraybuffer-constructor
description: Invoked with an options object whose `maxByteLength` property throws
info: |
ArrayBuffer( length [ , options ] )
1. If NewTarget is undefined, throw a TypeError exception.
2. Let byteLength be ? ToIndex(length).
3. Let requestedMaxByteLength be ? GetArrayBufferMaxByteLengthOption(options).
[...]
1.1.5 GetArrayBufferMaxByteLengthOption ( options )
1. If Type(options) is not Object, return empty.
2. Let maxByteLength be ? Get(options, "maxByteLength").
features: [resizable-arraybuffer]
--- |
1078 |
options-maxbytelength-undefined.js |
---
esid: sec-arraybuffer-constructor
description: Invoked with an options object whose `maxByteLength` property is undefined
info: |
ArrayBuffer( length [ , options ] )
1. If NewTarget is undefined, throw a TypeError exception.
2. Let byteLength be ? ToIndex(length).
3. Let requestedMaxByteLength be ? GetArrayBufferMaxByteLengthOption(options).
4. If requestedMaxByteLength is empty, then
a. Return ? AllocateArrayBuffer(NewTarget, byteLength).
1.1.5 GetArrayBufferMaxByteLengthOption ( options )
1. If Type(options) is not Object, return empty.
2. Let maxByteLength be ? Get(options, "maxByteLength").
3. If maxByteLength is undefined, return empty.
features: [resizable-arraybuffer]
--- |
1221 |
options-non-object.js |
---
esid: sec-arraybuffer-constructor
description: Invoked with a non-object value for options
info: |
ArrayBuffer( length [ , options ] )
1. If NewTarget is undefined, throw a TypeError exception.
2. Let byteLength be ? ToIndex(length).
3. Let requestedMaxByteLength be ? GetArrayBufferMaxByteLengthOption(options).
4. If requestedMaxByteLength is empty, then
a. Return ? AllocateArrayBuffer(NewTarget, byteLength).
1.1.5 GetArrayBufferMaxByteLengthOption ( options )
1. If Type(options) is not Object, return empty.
features: [resizable-arraybuffer]
--- |
1447 |
prop-desc.js |
---
esid: sec-arraybuffer-constructor
description: >
Property descriptor of ArrayBuffer
info: |
17 ECMAScript Standard Built-in Objects:
Every other data property described in clauses 18 through 26 and in Annex B.2
has the attributes { [[Writable]]: true, [[Enumerable]]: false,
[[Configurable]]: true } unless otherwise specified.
includes: [propertyHelper.js]
--- |
727 |
proto-from-ctor-realm.js |
---
esid: sec-arraybuffer-length
description: Default [[Prototype]] value derived from realm of the newTarget
info: |
[...]
5. Return ? AllocateArrayBuffer(NewTarget, byteLength).
9.1.14 GetPrototypeFromConstructor
[...]
3. Let proto be ? Get(constructor, "prototype").
4. If Type(proto) is not Object, then
a. Let realm be ? GetFunctionRealm(constructor).
b. Let proto be realm's intrinsic object named intrinsicDefaultProto.
[...]
features: [cross-realm, Reflect]
--- |
890 |
prototype |
|
|
prototype-from-newtarget.js |
---
esid: sec-arraybuffer-length
description: >
The [[Prototype]] internal slot is computed from NewTarget.
info: |
ArrayBuffer( length )
ArrayBuffer called with argument length performs the following steps:
...
6. Return AllocateArrayBuffer(NewTarget, byteLength).
AllocateArrayBuffer( constructor, byteLength )
1. Let obj be OrdinaryCreateFromConstructor(constructor, "%ArrayBufferPrototype%",
«[[ArrayBufferData]], [[ArrayBufferByteLength]]» ).
2. ReturnIfAbrupt(obj).
...
features: [Reflect.construct]
--- |
1212 |
return-abrupt-from-length-symbol.js |
---
esid: sec-arraybuffer-length
description: >
Throws a TypeError if length is a symbol
info: |
ArrayBuffer( length )
1. If NewTarget is undefined, throw a TypeError exception.
2. Let byteLength be ? ToIndex(length).
...
features: [Symbol]
--- |
539 |
return-abrupt-from-length.js |
---
esid: sec-arraybuffer-length
description: >
Return abrupt from ToIndex(length)
info: |
ArrayBuffer( length )
1. If NewTarget is undefined, throw a TypeError exception.
2. Let byteLength be ? ToIndex(length).
...
--- |
540 |
shell.js |
---
description: |
Test if a given function is a constructor function.
defines: [isConstructor]
features: [Reflect.construct]
--- |
596 |
Symbol.species |
|
|
toindex-length.js |
---
esid: sec-arraybuffer-length
description: >
The `length` parameter is converted to a value numeric index value.
info: |
ArrayBuffer( length )
1. If NewTarget is undefined, throw a TypeError exception.
2. Let byteLength be ? ToIndex(length).
3. Return ? AllocateArrayBuffer(NewTarget, byteLength).
ToIndex( value )
1. If value is undefined, then
a. Let index be 0.
2. Else,
a. Let integerIndex be ? ToInteger(value).
b. If integerIndex < 0, throw a RangeError exception.
c. Let index be ! ToLength(integerIndex).
d. If SameValueZero(integerIndex, index) is false, throw a RangeError exception.
3. Return index.
--- |
2311 |
undefined-newtarget-throws.js |
---
esid: sec-arraybuffer-length
description: >
Throws a TypeError if ArrayBuffer is called as a function.
info: |
ArrayBuffer( length )
ArrayBuffer called with argument length performs the following steps:
1. If NewTarget is undefined, throw a TypeError exception.
...
--- |
565 |
zero-length.js |
---
esid: sec-arraybuffer-length
description: >
The `length` parameter can be zero.
info: |
ArrayBuffer( length )
...
2. Let numberLength be ToNumber(length).
3. Let byteLength be ToLength(numberLength).
4. ReturnIfAbrupt(byteLength).
5. If SameValueZero(numberLength, byteLength) is false, throw a RangeError exception.
...
--- |
677 |