?
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 (a
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 (anything) 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 (a
The abstract operation IsUnclampedIntegerElementType takes argument type (a
The abstract operation IsBigIntElementType takes argument type (a
The abstract operation IsNoTearConfiguration takes arguments type (a
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.This function performs the following steps when called:
The ArrayBuffer
This function performs the following steps when called:
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
This method performs the following steps when called:
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 (a
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
This function performs the following steps when called:
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
This method performs the following steps when called:
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 (an
The abstract operation SetViewValue takes arguments view (an
The DataView
extends
clause of a class definition. Subclass super
call to the DataView DataView.prototype
built-in methods.This function performs the following steps when called:
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
This method performs the following steps when called:
This method performs the following steps when called:
This method performs the following steps when called:
This method performs the following steps when called:
This method performs the following steps when called:
This method performs the following steps when called:
This method performs the following steps when called:
This method performs the following steps when called:
This method performs the following steps when called:
This method performs the following steps when called:
This method performs the following steps when called:
This method performs the following steps when called:
This method performs the following steps when called:
This method performs the following steps when called:
This method performs the following steps when called:
This method performs the following steps when called:
This method performs the following steps when called:
This method performs the following steps when called:
This method performs the following steps when called:
This method performs the following steps when called:
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 (an
The abstract operation ValidateAtomicAccess takes arguments typedArray (a TypedArray) and requestIndex (an
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
additionalTimeout allows implementations to pad timeouts as necessary, such as for reducing power consumption or coarsening timer resolution to mitigate timing attacks. This value may differ from call to call of SuspendAgent.
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 (an
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
This function performs the following steps when called:
This function performs the following steps when called:
&
, xBytes, yBytes).This function performs the following steps when called:
This function performs the following steps when called:
This function performs the following steps when called:
This function 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 Atomics.isLockFree
(n) will return
Atomics.isLockFree
(4) always returns
Regardless of the value returned by this function, 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").
This function performs the following steps when called:
This function performs the following steps when called:
|
, xBytes, yBytes).This function performs the following steps when called:
This function performs the following steps when called:
This function puts the
It performs the following steps when called:
This function notifies some
It performs the following steps when called:
This function performs the following steps when called:
^
, 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.
This 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
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.
This function returns a String in UTF-16 encoded JSON format representing an
It performs the following steps when called:
The
JSON structures are allowed to be nested to any depth, but they must be acyclic. If value is or contains a cyclic structure, then this 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).
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
A JSON Serialization Record is a
JSON Serialization Records have the fields listed in
Field Name | Value | Meaning |
---|---|---|
[[ReplacerFunction]] | a |
A function that can supply replacement values for object properties (from JSON.stringify's replacer parameter). |
[[PropertyList]] | either a |
The names of properties to include when serializing a non-array object (from JSON.stringify's replacer parameter). |
[[Gap]] | a String | The unit of indentation (from JSON.stringify's space parameter). |
[[Stack]] | a |
The set of nested objects that are in the process of being serialized. Used to detect cyclic structures. |
[[Indent]] | a String | The current indentation. |
The abstract operation SerializeJSONProperty takes arguments state (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 (a
The abstract operation SerializeJSONArray takes arguments state (a
The representation of arrays includes only the elements in the array.length
(exclusive). Properties whose keys are not
The initial value of the
This property has the attributes { [[Writable]]: