?
u
m
/
The descriptions below in this section,
A read-modify-write modification function is a mathematical function that is notationally represented as an abstract closure that takes two
To aid verifying that a read-modify-write modification function's algorithm steps constitute a pure, mathematical function, the following editorial conventions are recommended:
The abstract operation AllocateArrayBuffer takes arguments constructor and byteLength (a non-negative
The abstract operation IsDetachedBuffer takes argument arrayBuffer (an ArrayBuffer or a SharedArrayBuffer) and returns a Boolean. It performs the following steps when called:
The abstract operation DetachArrayBuffer takes argument arrayBuffer (an ArrayBuffer) and optional argument key and returns either a
Detaching an ArrayBuffer instance disassociates the
The abstract operation CloneArrayBuffer takes arguments srcBuffer (an ArrayBuffer or a SharedArrayBuffer), srcByteOffset (a non-negative
The abstract operation IsUnsignedElementType takes argument type and returns a Boolean. It verifies if the argument type is an unsigned
The abstract operation IsUnclampedIntegerElementType takes argument type and returns a Boolean. It verifies if the argument type is an
The abstract operation IsBigIntElementType takes argument type and returns a Boolean. It verifies if the argument type is a BigInt
The abstract operation IsNoTearConfiguration takes arguments type and order and returns a Boolean. It performs the following steps when called:
The abstract operation RawBytesToNumeric takes arguments type (a
The abstract operation GetValueFromBuffer takes arguments arrayBuffer (an ArrayBuffer or SharedArrayBuffer), byteIndex (a non-negative
The abstract operation NumericToRawBytes takes arguments type (a
The abstract operation SetValueInBuffer takes arguments arrayBuffer (an ArrayBuffer or SharedArrayBuffer), byteIndex (a non-negative
The abstract operation GetModifySetValueInBuffer takes arguments arrayBuffer (an ArrayBuffer or a SharedArrayBuffer), byteIndex (a non-negative
The ArrayBuffer
extends
clause of a class definition. Subclass super
call to the ArrayBuffer ArrayBuffer.prototype
built-in methods.When the ArrayBuffer
function is called with argument length, the following steps are taken:
The ArrayBuffer
The isView
function takes one argument arg, and performs the following steps:
The initial value of ArrayBuffer.prototype
is the
This property has the attributes { [[Writable]]:
ArrayBuffer[@@species]
is an
The value of the
ArrayBuffer prototype methods normally use their
The ArrayBuffer prototype object:
ArrayBuffer.prototype.byteLength
is an
The initial value of ArrayBuffer.prototype.constructor
is
The following steps are taken:
The initial value of the
This property has the attributes { [[Writable]]:
ArrayBuffer instances inherit properties from the
ArrayBuffer instances whose [[ArrayBufferData]] is
ArrayBuffer instances whose [[ArrayBufferDetachKey]] is set to a value other than
The abstract operation AllocateSharedArrayBuffer takes arguments constructor and byteLength (a non-negative
The abstract operation IsSharedArrayBuffer takes argument obj (an ArrayBuffer or a SharedArrayBuffer) and returns a Boolean. It tests whether an object is an ArrayBuffer, a SharedArrayBuffer, or a subtype of either. It performs the following steps when called:
The SharedArrayBuffer
extends
clause of a class definition. Subclass super
call to the SharedArrayBuffer SharedArrayBuffer.prototype
built-in methods.Whenever a
Unlike an ArrayBuffer
, a SharedArrayBuffer
cannot become detached, and its internal [[ArrayBufferData]] slot is never
When the SharedArrayBuffer
function is called with argument length, the following steps are taken:
The SharedArrayBuffer
The initial value of SharedArrayBuffer.prototype
is the
This property has the attributes { [[Writable]]:
SharedArrayBuffer[@@species]
is an
The value of the
The SharedArrayBuffer prototype object:
SharedArrayBuffer.prototype.byteLength
is an
The initial value of SharedArrayBuffer.prototype.constructor
is
The following steps are taken:
The initial value of the
This property has the attributes { [[Writable]]:
SharedArrayBuffer instances inherit properties from the
SharedArrayBuffer instances, unlike ArrayBuffer instances, are never detached.
The abstract operation GetViewValue takes arguments view, requestIndex, isLittleEndian, and type and returns either a
The abstract operation SetViewValue takes arguments view, requestIndex, isLittleEndian, type, and value and returns either a
The DataView
extends
clause of a class definition. Subclass super
call to the DataView DataView.prototype
built-in methods.When the DataView
function is called with at least one argument buffer, the following steps are taken:
The DataView
The initial value of DataView.prototype
is the
This property has the attributes { [[Writable]]:
The DataView prototype object:
DataView.prototype.buffer
is an
DataView.prototype.byteLength
is an
DataView.prototype.byteOffset
is an
The initial value of DataView.prototype.constructor
is
When the getBigInt64
method is called with argument byteOffset and optional argument littleEndian, the following steps are taken:
When the getBigUint64
method is called with argument byteOffset and optional argument littleEndian, the following steps are taken:
When the getFloat32
method is called with argument byteOffset and optional argument littleEndian, the following steps are taken:
When the getFloat64
method is called with argument byteOffset and optional argument littleEndian, the following steps are taken:
When the getInt8
method is called with argument byteOffset, the following steps are taken:
When the getInt16
method is called with argument byteOffset and optional argument littleEndian, the following steps are taken:
When the getInt32
method is called with argument byteOffset and optional argument littleEndian, the following steps are taken:
When the getUint8
method is called with argument byteOffset, the following steps are taken:
When the getUint16
method is called with argument byteOffset and optional argument littleEndian, the following steps are taken:
When the getUint32
method is called with argument byteOffset and optional argument littleEndian, the following steps are taken:
When the setBigInt64
method is called with arguments byteOffset and value and optional argument littleEndian, the following steps are taken:
When the setBigUint64
method is called with arguments byteOffset and value and optional argument littleEndian, the following steps are taken:
When the setFloat32
method is called with arguments byteOffset and value and optional argument littleEndian, the following steps are taken:
When the setFloat64
method is called with arguments byteOffset and value and optional argument littleEndian, the following steps are taken:
When the setInt8
method is called with arguments byteOffset and value, the following steps are taken:
When the setInt16
method is called with arguments byteOffset and value and optional argument littleEndian, the following steps are taken:
When the setInt32
method is called with arguments byteOffset and value and optional argument littleEndian, the following steps are taken:
When the setUint8
method is called with arguments byteOffset and value, the following steps are taken:
When the setUint16
method is called with arguments byteOffset and value and optional argument littleEndian, the following steps are taken:
When the setUint32
method is called with arguments byteOffset and value and optional argument littleEndian, the following steps are taken:
The initial value of the
This property has the attributes { [[Writable]]:
DataView instances are
The value of the [[DataView]] internal slot is not used within this specification. The simple presence of that internal slot is used within the specification to identify objects created using the DataView
The Atomics object:
new
operator.The Atomics object provides functions that operate indivisibly (atomically) on shared memory array cells as well as functions that let
For informative guidelines for programming and implementing shared memory in ECMAScript, please see the notes at the end of the
A WaiterList is a semantic object that contains an ordered list of
Initially a WaiterList object has an empty list and no
The
Each WaiterList has a critical section that controls exclusive access to that WaiterList during evaluation. Only a single
The abstract operation ValidateIntegerTypedArray takes argument typedArray and optional argument waitable (a Boolean) and returns either a
The abstract operation ValidateAtomicAccess takes arguments typedArray (a TypedArray) and requestIndex and returns either a
The abstract operation GetWaiterList takes arguments block (a
The abstract operation EnterCriticalSection takes argument WL (a
EnterCriticalSection has contention when an
The abstract operation LeaveCriticalSection takes argument WL (a
The abstract operation AddWaiter takes arguments WL (a
The abstract operation RemoveWaiter takes arguments WL (a
The abstract operation RemoveWaiters takes arguments WL (a
The abstract operation SuspendAgent takes arguments WL (a
The abstract operation NotifyWaiter takes arguments WL (a
The embedding may delay notifying W, e.g. for resource management reasons, but W must eventually be notified in order to guarantee forward progress.
The abstract operation AtomicReadModifyWrite takes arguments typedArray, index, value, and op (a
The abstract operation ByteListBitwiseOp takes arguments op (&
, ^
, or |
), xBytes (a
&
, let resultByte be the result of applying the bitwise AND operation to xByte and yByte.^
, let resultByte be the result of applying the bitwise exclusive OR (XOR) operation to xByte and yByte.|
. Let resultByte be the result of applying the bitwise inclusive OR operation to xByte and yByte.The abstract operation ByteListEqual takes arguments xBytes (a
The following steps are taken:
The following steps are taken:
&
, xBytes, yBytes).The following steps are taken:
The following steps are taken:
The following steps are taken:
Atomics.isLockFree
() is an optimization primitive. The intuition is that if the atomic step of an atomic primitive (compareExchange
, load
, store
, add
, sub
, and
, or
, xor
, or exchange
) on a datum of size n bytes will be performed without the calling Atomics.isLockFree
(n) will return Atomics.isLockFree
to determine whether to use locks or atomic operations in
Atomics.isLockFree
(4) always returns
Regardless of the value of Atomics.isLockFree
, all atomic operations are guaranteed to be atomic. For example, they will never have a visible operation take place in the middle of the operation (e.g., "tearing").
The following steps are taken:
The following steps are taken:
|
, xBytes, yBytes).The following steps are taken:
The following steps are taken:
Atomics.wait
puts the calling
Atomics.notify
notifies some
The following steps are taken:
^
, xBytes, yBytes).The initial value of the
This property has the attributes { [[Writable]]:
The JSON object:
parse
and stringify
, that are used to parse and construct JSON texts.new
operator.The JSON Data Interchange Format is defined in ECMA-404. The JSON interchange format used in this specification is exactly that described by ECMA-404. Conforming implementations of JSON.parse
and JSON.stringify
must support the exact interchange format described in the ECMA-404 specification without any deletions or extensions to the format.
The parse
function parses a JSON text (a JSON-formatted String) and produces an
The optional reviver parameter is a function that takes two parameters, key and value. It can filter and transform the results. It is called with each of the key/value pairs produced by the parse, and its return value is used instead of the original value. If it returns what it received, the structure is not modified. If it returns
The parse
function is
Valid JSON text is a subset of the ECMAScript
However, because JSON.parse
, the same source text can produce different results when evaluated as a JSON.parse
, means that not all texts accepted by JSON.parse
are valid as a
The abstract operation InternalizeJSONProperty takes arguments holder (an Object), name (a String), and reviver (a
This algorithm intentionally does not throw an exception if either [[Delete]] or
It performs the following steps when called:
It is not permitted for a conforming implementation of JSON.parse
to extend the JSON grammars. If an implementation wishes to support a modified or extended JSON interchange format it must do so by defining a different parse function.
In the case where there are duplicate name Strings within an object, lexically preceding values for the same key shall be overwritten.
The stringify
function returns a String in UTF-16 encoded JSON format representing an
These are the steps in stringifying an object:
The stringify
function is
JSON structures are allowed to be nested to any depth, but they must be acyclic. If value is or contains a cyclic structure, then the stringify function must throw a
a = [];
a[0] = a;
my_text = JSON.stringify(a); // This must throw a TypeError.
Symbolic primitive values are rendered as follows:
String values are wrapped in QUOTATION MARK ("
) code units. The code units "
and \
are escaped with \
prefixes. Control characters code units are replaced with escape sequences \u
HHHH, or with the shorter forms, \b
(BACKSPACE), \f
(FORM FEED), \n
(LINE FEED), \r
(CARRIAGE RETURN), \t
(CHARACTER TABULATION).
Finite numbers are stringified as if by calling
Values that do not have a JSON representation (such as
An object is rendered as U+007B (LEFT CURLY BRACKET) followed by zero or more properties, separated with a U+002C (COMMA), closed with a U+007D (RIGHT CURLY BRACKET). A property is a quoted String representing the key or
The abstract operation SerializeJSONProperty takes arguments state, key, and holder and returns either a
The abstract operation QuoteJSONString takes argument value (a String) and returns a String. It wraps value in 0x0022 (QUOTATION MARK) code units and escapes certain other code units within it. This operation interprets value as a sequence of UTF-16 encoded code points, as described in
Code Point | Unicode Character Name | Escape Sequence |
---|---|---|
U+0008 | BACKSPACE |
\b
|
U+0009 | CHARACTER TABULATION |
\t
|
U+000A | LINE FEED (LF) |
\n
|
U+000C | FORM FEED (FF) |
\f
|
U+000D | CARRIAGE RETURN (CR) |
\r
|
U+0022 | QUOTATION MARK |
\"
|
U+005C | REVERSE SOLIDUS |
\\
|
The abstract operation UnicodeEscape takes argument C (a code unit) and returns a String. It represents C as a Unicode escape sequence. It performs the following steps when called:
The abstract operation SerializeJSONObject takes arguments state and value (an Object) and returns either a
The abstract operation SerializeJSONArray takes arguments state and value (an
The representation of arrays includes only the elements between zero and array.length
- 1
The initial value of the
This property has the attributes { [[Writable]]: