Skip to content

Commit

Permalink
Editorial: Clean up StringGetOwnProperty (#3523)
Browse files Browse the repository at this point in the history
Remove a redundant check and swap comparison operands for a more conventional ordering.
  • Loading branch information
gibson042 authored and ljharb committed Jan 16, 2025
1 parent 0d1e2a8 commit f2eff8d
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions spec.html
Original file line number Diff line number Diff line change
Expand Up @@ -14430,13 +14430,12 @@ <h1>
<emu-alg>
1. If _P_ is not a String, return *undefined*.
1. Let _index_ be CanonicalNumericIndexString(_P_).
1. If _index_ is *undefined*, return *undefined*.
1. If _index_ is not an integral Number, return *undefined*.
1. If _index_ is *-0*<sub>𝔽</sub> or _index_ &lt; *-0*<sub>𝔽</sub>, return *undefined*.
1. Let _str_ be _S_.[[StringData]].
1. Assert: _str_ is a String.
1. Let _len_ be the length of _str_.
1. If _len_ ≤ ℝ(_index_), return *undefined*.
1. If ℝ(_index_) ≥ _len_, return *undefined*.
1. Let _resultStr_ be the substring of _str_ from ℝ(_index_) to ℝ(_index_) + 1.
1. Return the PropertyDescriptor { [[Value]]: _resultStr_, [[Writable]]: *false*, [[Enumerable]]: *true*, [[Configurable]]: *false* }.
</emu-alg>
Expand Down

0 comments on commit f2eff8d

Please sign in to comment.