Skip to content

Commit 3c049b9

Browse files
authored
Normative: Validate DataView buffer mutability before argument coercion (#37)
Ref #31
1 parent d0427b0 commit 3c049b9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

spec.emu

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -717,6 +717,7 @@ contributors: Mark S. Miller, Richard Gibson
717717
<emu-alg>
718718
1. Perform ? RequireInternalSlot(_view_, [[DataView]]).
719719
1. Assert: _view_ has a [[ViewedArrayBuffer]] internal slot.
720+
1. <ins>If IsImmutableBuffer(_view_.[[ViewedArrayBuffer]]) is *true*, throw a *TypeError* exception.</ins>
720721
1. Let _getIndex_ be ? ToIndex(_requestIndex_).
721722
1. If IsBigIntElementType(_type_) is *true*, let _numberValue_ be ? ToBigInt(_value_).
722723
1. Otherwise, let _numberValue_ be ? ToNumber(_value_).
@@ -725,7 +726,6 @@ contributors: Mark S. Miller, Richard Gibson
725726
1. Let _viewRecord_ be MakeDataViewWithBufferWitnessRecord(_view_, ~unordered~).
726727
1. NOTE: Bounds checking is not a synchronizing operation when _view_'s backing buffer is a growable SharedArrayBuffer.
727728
1. If IsViewOutOfBounds(_viewRecord_) is *true*, throw a *TypeError* exception.
728-
1. <ins>If IsImmutableBuffer(_view_.[[ViewedArrayBuffer]]) is *true*, throw a *TypeError* exception.</ins>
729729
1. Let _viewSize_ be GetViewByteLength(_viewRecord_).
730730
1. Let _elementSize_ be the Element Size value specified in <emu-xref href="#table-the-typedarray-constructors"></emu-xref> for Element Type _type_.
731731
1. If _getIndex_ + _elementSize_ > _viewSize_, throw a *RangeError* exception.

0 commit comments

Comments
 (0)