Skip to content

Commit 3b24900

Browse files
authored
Editorial: Improve/explain operation parameter names (#33)
Ref #30
1 parent 4f18004 commit 3b24900

File tree

1 file changed

+11
-10
lines changed

1 file changed

+11
-10
lines changed

spec.emu

+11-10
Original file line numberDiff line numberDiff line change
@@ -342,16 +342,16 @@ contributors: Mark S. Miller, Richard Gibson
342342
ValidateTypedArray (
343343
_O_: an ECMAScript language value,
344344
_order_: ~seq-cst~ or ~unordered~,
345-
<ins>optional _use_: ~read~ or ~write~,</ins>
345+
<ins>optional _accessMode_: ~read~ or ~write~,</ins>
346346
): either a normal completion containing a TypedArray With Buffer Witness Record or a throw completion
347347
</h1>
348348
<dl class="header">
349349
</dl>
350350
<emu-alg>
351-
1. <ins>If _use_ is not present, set _use_ to ~read~.</ins>
351+
1. <ins>If _accessMode_ is not present, set _accessMode_ to ~read~.</ins>
352352
1. Perform ? RequireInternalSlot(_O_, [[TypedArrayName]]).
353353
1. Assert: _O_ has a [[ViewedArrayBuffer]] internal slot.
354-
1. <ins>If _use_ is ~write~ and IsImmutableBuffer(_O_.[[ViewedArrayBuffer]]) is *true*, throw a *TypeError* exception.</ins>
354+
1. <ins>If _accessMode_ is ~write~ and IsImmutableBuffer(_O_.[[ViewedArrayBuffer]]) is *true*, throw a *TypeError* exception.</ins>
355355
1. Let _taRecord_ be MakeTypedArrayWithBufferWitnessRecord(_O_, _order_).
356356
1. If IsTypedArrayOutOfBounds(_taRecord_) is *true*, throw a *TypeError* exception.
357357
1. Return _taRecord_.
@@ -375,13 +375,14 @@ contributors: Mark S. Miller, Richard Gibson
375375
AllocateArrayBuffer (
376376
_constructor_: a constructor,
377377
_byteLength_: a non-negative integer,
378-
optional _maxByteLength_: a non-negative integer, or either ~empty~ or ~immutable~,
378+
optional _maxByteLength_: a non-negative integer, <del>or ~empty~</del> <ins>or either ~empty~ or ~immutable~</ins>,
379379
): either a normal completion containing an ArrayBuffer or a throw completion
380380
</h1>
381381
<dl class="header">
382382
<dt>description</dt>
383383
<dd>It is used to create an ArrayBuffer.</dd>
384384
</dl>
385+
<emu-note type="editor">The current name and domain of parameter _maxByteLength_ is preserved for the benefit of diff readability, but both may be subject to change before acceptance into ECMA-262.</emu-note>
385386
<emu-alg>
386387
1. Let _slots_ be « [[ArrayBufferData]], [[ArrayBufferByteLength]], [[ArrayBufferDetachKey]] ».
387388
1. If _maxByteLength_ is present and _maxByteLength_ is <del>not ~empty~</del> <ins>an integer</ins>, let _allocatingResizableBuffer_ be *true*; otherwise let _allocatingResizableBuffer_ be *false*.
@@ -744,14 +745,14 @@ contributors: Mark S. Miller, Richard Gibson
744745
ValidateIntegerTypedArray (
745746
_typedArray_: an ECMAScript language value,
746747
_waitable_: a Boolean,
747-
<ins>optional _use_: ~read~ or ~write~,</ins>
748+
<ins>optional _accessMode_: ~read~ or ~write~,</ins>
748749
): either a normal completion containing a TypedArray With Buffer Witness Record, or a throw completion
749750
</h1>
750751
<dl class="header">
751752
</dl>
752753
<emu-alg>
753-
1. <ins>If _use_ is not present, set _use_ to ~read~.</ins>
754-
1. Let _taRecord_ be ? ValidateTypedArray(_typedArray_, ~unordered~<ins>, _use_</ins>).
754+
1. <ins>If _accessMode_ is not present, set _accessMode_ to ~read~.</ins>
755+
1. Let _taRecord_ be ? ValidateTypedArray(_typedArray_, ~unordered~<ins>, _accessMode_</ins>).
755756
1. NOTE: Bounds checking is not a synchronizing operation when _typedArray_'s backing buffer is a growable SharedArrayBuffer.
756757
1. If _waitable_ is *true*, then
757758
1. If _typedArray_.[[TypedArrayName]] is neither *"Int32Array"* nor *"BigInt64Array"*, throw a *TypeError* exception.
@@ -768,15 +769,15 @@ contributors: Mark S. Miller, Richard Gibson
768769
_typedArray_: an ECMAScript language value,
769770
_requestIndex_: an ECMAScript language value,
770771
optional _waitable_: a Boolean,
771-
<ins>optional _use_: ~read~ or ~write~,</ins>
772+
<ins>optional _accessMode_: ~read~ or ~write~,</ins>
772773
): either a normal completion containing an integer or a throw completion
773774
</h1>
774775
<dl class="header">
775776
</dl>
776777
<emu-alg>
777778
1. If _waitable_ is not present, set _waitable_ to *false*.
778-
1. <ins>If _use_ is not present, set _use_ to ~read~.</ins>
779-
1. Let _taRecord_ be ? ValidateIntegerTypedArray(_typedArray_, _waitable_<ins>, _use_</ins>).
779+
1. <ins>If _accessMode_ is not present, set _accessMode_ to ~read~.</ins>
780+
1. Let _taRecord_ be ? ValidateIntegerTypedArray(_typedArray_, _waitable_<ins>, _accessMode_</ins>).
780781
1. Return ? ValidateAtomicAccess(_taRecord_, _requestIndex_).
781782
</emu-alg>
782783
</emu-clause>

0 commit comments

Comments
 (0)