allocation-limit.js |
---
esid: sec-sharedarraybuffer-length
description: >
Throws a RangeError if requested Data Block is too large.
info: |
SharedArrayBuffer( length )
...
3. Return AllocateSharedArrayBuffer(NewTarget, byteLength).
6.2.7.2 CreateSharedByteDataBlock(size)
...
2. Let db be a new Shared Data Block value consisting of size
bytes. If it is impossible to create such a Shared Data Block,
throw a RangeError exception.
...
features: [SharedArrayBuffer]
--- |
1277 |
browser.js |
|
0 |
data-allocation-after-object-creation.js |
---
esid: sec-sharedarraybuffer-length
description: >
The new SharedArrayBuffer instance is created prior to allocating the Data Block.
info: |
SharedArrayBuffer( length )
...
3. Return AllocateSharedArrayBuffer(NewTarget, byteLength).
AllocateSharedArrayBuffer( constructor, byteLength )
1. Let obj be ? OrdinaryCreateFromConstructor(constructor, "%SharedArrayBufferPrototype%",
«[[ArrayBufferData]], [[ArrayBufferByteLength]]» ).
...
3. Let block be ? CreateByteDataBlock(byteLength).
...
features: [SharedArrayBuffer, Reflect.construct]
--- |
1305 |
init-zero.js |
---
esid: sec-createsharedbytedatablock
description: All bytes are initialized to zero
features: [SharedArrayBuffer, DataView]
--- |
979 |
is-a-constructor.js |
---
esid: sec-ecmascript-standard-built-in-objects
description: >
The SharedArrayBuffer 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, SharedArrayBuffer]
--- |
1018 |
length-is-absent.js |
---
esid: sec-sharedarraybuffer-length
description: >
Returns an empty instance if length is absent
info: |
SharedArrayBuffer( length )
1. If NewTarget is undefined, throw a TypeError exception.
2. Let byteLength be ? ToIndex(length).
3. Return ? AllocateSharedArrayBuffer(NewTarget, byteLength).
features: [SharedArrayBuffer]
--- |
767 |
length-is-too-large-throws.js |
---
esid: sec-sharedarraybuffer-length
description: >
Throws a RangeError if length >= 2 ** 53
info: |
SharedArrayBuffer( 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.
...
features: [SharedArrayBuffer]
--- |
1093 |
length.js |
---
esid: sec-sharedarraybuffer-constructor
description: >
SharedArrayBuffer.length is 1.
info: |
SharedArrayBuffer( 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: [SharedArrayBuffer]
--- |
1249 |
negative-length-throws.js |
---
esid: sec-sharedarraybuffer-length
description: >
Throws a Range Error if length represents an integer < 0
info: |
SharedArrayBuffer( 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.
...
features: [SharedArrayBuffer]
--- |
1061 |
newtarget-prototype-is-not-object.js |
---
esid: sec-sharedarraybuffer-length
description: >
[[Prototype]] defaults to %SharedArrayBufferPrototype% if NewTarget.prototype is not an object.
info: |
SharedArrayBuffer( length )
SharedArrayBuffer called with argument length performs the following steps:
...
3. Return AllocateSharedArrayBuffer(NewTarget, byteLength).
AllocateSharedArrayBuffer( constructor, byteLength )
1. Let obj be ? OrdinaryCreateFromConstructor(constructor, "%SharedArrayBufferPrototype%",
«[[ArrayBufferData]], [[ArrayBufferByteLength]]» ).
...
features: [SharedArrayBuffer, Symbol, Reflect.construct]
--- |
2296 |
options-maxbytelength-allocation-limit.js |
---
esid: sec-sharedarraybuffer-length
description: >
Throws a RangeError if the requested Data Block is too large.
info: |
SharedArrayBuffer ( length [ , options ] )
...
4. Return ? AllocateSharedArrayBuffer(NewTarget, byteLength, requestedMaxByteLength).
AllocateSharedArrayBuffer ( constructor, byteLength [ , maxByteLength ] )
...
7. Let block be ? CreateSharedByteDataBlock(allocLength).
...
CreateSharedByteDataBlock ( size )
1. Let db be a new Shared Data Block value consisting of size bytes. If it is
impossible to create such a Shared Data Block, throw a RangeError exception.
features: [SharedArrayBuffer, resizable-arraybuffer]
--- |
1590 |
options-maxbytelength-compared-before-object-creation.js |
---
esid: sec-sharedarraybuffer-length
description: >
The byteLength argument is validated before OrdinaryCreateFromConstructor.
info: |
SharedArrayBuffer ( length [ , options ] )
...
4. Return ? AllocateSharedArrayBuffer(NewTarget, byteLength, requestedMaxByteLength).
AllocateSharedArrayBuffer ( constructor, byteLength [ , maxByteLength ] )
...
3. If allocatingGrowableBuffer is true, then
a. If byteLength > maxByteLength, throw a RangeError exception.
...
5. Let obj be ? OrdinaryCreateFromConstructor(constructor, "%SharedArrayBuffer.prototype%", slots).
...
features: [SharedArrayBuffer, resizable-arraybuffer, Reflect.construct]
--- |
1484 |
options-maxbytelength-data-allocation-after-object-creation.js |
---
esid: sec-sharedarraybuffer-length
description: >
The new SharedArrayBuffer instance is created prior to allocating the Data Block.
info: |
SharedArrayBuffer ( length [ , options ] )
...
4. Return ? AllocateSharedArrayBuffer(NewTarget, byteLength, requestedMaxByteLength).
AllocateSharedArrayBuffer( constructor, byteLength )
...
5. Let obj be ? OrdinaryCreateFromConstructor(constructor, "%SharedArrayBuffer.prototype%", slots).
...
7. Let block be ? CreateSharedByteDataBlock(allocLength).
...
features: [SharedArrayBuffer, resizable-arraybuffer, Reflect.construct]
--- |
1445 |
options-maxbytelength-diminuitive.js |
---
esid: sec-sharedarraybuffer-constructor
description: |
Invoked with an options object whose `maxByteLength` property is less than
the length.
info: |
SharedArrayBuffer( 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: [SharedArrayBuffer, resizable-arraybuffer]
--- |
1092 |
options-maxbytelength-excessive.js |
---
esid: sec-sharedarraybuffer-constructor
description: |
Invoked with an options object whose `maxByteLength` property exceeds the
maximum length value
info: |
SharedArrayBuffer( 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: [SharedArrayBuffer, resizable-arraybuffer]
--- |
1284 |
options-maxbytelength-negative.js |
---
esid: sec-sharedarraybuffer-constructor
description: Invoked with an options object whose `maxByteLength` property is negative
info: |
SharedArrayBuffer( 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: [SharedArrayBuffer, resizable-arraybuffer]
--- |
1203 |
options-maxbytelength-object.js |
---
esid: sec-sharedarraybuffer-constructor
description: |
Invoked with an options object whose `maxByteLength` property cannot be
coerced to a primitive value
info: |
SharedArrayBuffer( 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: [SharedArrayBuffer, resizable-arraybuffer]
--- |
1542 |
options-maxbytelength-poisoned.js |
---
esid: sec-sharedarraybuffer-constructor
description: Invoked with an options object whose `maxByteLength` property throws
info: |
SharedArrayBuffer( 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: [SharedArrayBuffer, resizable-arraybuffer]
--- |
1176 |
options-maxbytelength-undefined.js |
---
esid: sec-sharedarraybuffer-constructor
description: Invoked with an options object whose `maxByteLength` property is undefined
info: |
SharedArrayBuffer( 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 ? AllocateSharedArrayBuffer(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: [SharedArrayBuffer, resizable-arraybuffer]
--- |
1329 |
options-non-object.js |
---
esid: sec-sharedarraybuffer-constructor
description: Invoked with a non-object value for options
info: |
SharedArrayBuffer( 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: [BigInt, SharedArrayBuffer, Symbol, resizable-arraybuffer]
--- |
1590 |
proto-from-ctor-realm.js |
---
esid: sec-sharedarraybuffer-length
description: Default [[Prototype]] value derived from realm of the newTarget
info: |
[...]
3. Return ? AllocateSharedArrayBuffer(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: [SharedArrayBuffer, cross-realm, Reflect]
--- |
1114 |
prototype |
|
|
prototype-from-newtarget.js |
---
esid: sec-sharedarraybuffer-length
description: >
The [[Prototype]] internal slot is computed from NewTarget.
info: |
SharedArrayBuffer( length )
SharedArrayBuffer called with argument length performs the following steps:
...
3. Return AllocateSharedArrayBuffer(NewTarget, byteLength).
AllocateSharedArrayBuffer( constructor, byteLength )
1. Let obj be ? OrdinaryCreateFromConstructor(constructor, "%SharedArrayBufferPrototype%",
«[[ArrayBufferData]], [[ArrayBufferByteLength]]» ).
...
features: [Reflect, Reflect.construct, SharedArrayBuffer]
--- |
1442 |
return-abrupt-from-length-symbol.js |
---
esid: sec-sharedarraybuffer-length
description: >
Throws a TypeError if length is a symbol
info: |
SharedArrayBuffer( length )
1. If NewTarget is undefined, throw a TypeError exception.
2. Let byteLength be ? ToIndex(length).
...
features: [SharedArrayBuffer, Symbol]
--- |
756 |
return-abrupt-from-length.js |
---
esid: sec-sharedarraybuffer-length
description: >
Return abrupt from ToIndex(length)
info: |
SharedArrayBuffer( length )
1. If NewTarget is undefined, throw a TypeError exception.
2. Let byteLength be ? ToIndex(length).
...
features: [SharedArrayBuffer]
--- |
768 |
shell.js |
---
description: |
Test if a given function is a constructor function.
defines: [isConstructor]
features: [Reflect.construct]
--- |
596 |
toindex-length.js |
---
esid: sec-sharedarraybuffer-length
description: >
The `length` parameter is converted to a value numeric index value.
info: |
SharedArrayBuffer( length )
1. If NewTarget is undefined, throw a TypeError exception.
2. Let byteLength be ? ToIndex(length).
3. Return ? AllocateSharedArrayBuffer(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.
features: [SharedArrayBuffer]
--- |
2635 |
undefined-newtarget-throws.js |
---
esid: sec-sharedarraybuffer-length
description: >
Throws a TypeError if SharedArrayBuffer is called as a function.
info: |
SharedArrayBuffer( length )
SharedArrayBuffer called with argument length performs the following steps:
1. If NewTarget is undefined, throw a TypeError exception.
...
features: [SharedArrayBuffer]
--- |
811 |
zero-length.js |
---
esid: sec-sharedarraybuffer-length
description: >
The `length` parameter can be zero.
info: |
SharedArrayBuffer( 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.
...
features: [SharedArrayBuffer]
--- |
911 |