Skip to content

Commit

Permalink
[spec] fromHexInto/fromBase64Into: fix infinite loop (#48)
Browse files Browse the repository at this point in the history
  • Loading branch information
ljharb authored Jan 28, 2024
1 parent 49ad7cf commit 43885de
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions spec.html
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,10 @@ <h1>Uint8Array.fromBase64Into ( _string_, _into_ [ , _options_ ] )</h1>
1. Let _offset_ be _into_.[[ByteOffset]].
1. Let _index_ be 0.
1. Repeat, while _index_ < _written_,
1. Let _byte_ be _bytes_[i].
1. Let _byte_ be _bytes_[_index_].
1. Let _byteIndexInBuffer_ be _index_ + _offset_.
1. Perform SetValueInBuffer(_into_.[[ViewedArrayBuffer]], _byteIndexInBuffer_, ~uint8~, 𝔽(_byte_), *true*, ~unordered~).
1. Set _index_ to _index_ + 1.
1. Let _resultObject_ be OrdinaryObjectCreate(%Object.prototype%).
1. Perform ! CreateDataPropertyOrThrow(_resultObject_, *"read"*, 𝔽(_result_.[[Read]])).
1. Perform ! CreateDataPropertyOrThrow(_resultObject_, *"written"*, 𝔽(_written_)).
Expand Down Expand Up @@ -133,9 +134,10 @@ <h1>Uint8Array.fromHexInto ( _string_, _into_ )</h1>
1. Let _offset_ be _into_.[[ByteOffset]].
1. Let _index_ be 0.
1. Repeat, while _index_ < _written_,
1. Let _byte_ be _bytes_[i].
1. Let _byte_ be _bytes_[_index_].
1. Let _byteIndexInBuffer_ be _index_ + _offset_.
1. Perform SetValueInBuffer(_into_.[[ViewedArrayBuffer]], _byteIndexInBuffer_, ~uint8~, 𝔽(_byte_), *true*, ~unordered~).
1. Set _index_ to _index_ + 1.
1. Let _resultObject_ be OrdinaryObjectCreate(%Object.prototype%).
1. Perform ! CreateDataPropertyOrThrow(_resultObject_, *"read"*, 𝔽(_result_.[[Read]])).
1. Perform ! CreateDataPropertyOrThrow(_resultObject_, *"written"*, 𝔽(_written_)).
Expand Down

0 comments on commit 43885de

Please sign in to comment.