Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Editorial: Use internal spec value for param #52

Merged
merged 1 commit into from
Nov 13, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions spec.emu
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ contributors: "Jack Works"
<emu-clause id="sec-number-range">
<h1>Number.range(_start_, _end_, _option_)</h1>
<emu-alg>
1. Return ? CreateNumericRangeIterator(_start_, _end_, _option_, *"number"*).
1. Return ? CreateNumericRangeIterator(_start_, _end_, _option_, ~number-range~).
</emu-alg>
</emu-clause>
</emu-clause>
Expand All @@ -23,7 +23,7 @@ contributors: "Jack Works"
<emu-clause id="sec-bigint-range">
<h1>BigInt.range(_start_, _end_, _option_)</h1>
<emu-alg>
1. Return ? CreateNumericRangeIterator(_start_, _end_, _option_, *"bigint"*).
1. Return ? CreateNumericRangeIterator(_start_, _end_, _option_, ~bigint-range~).
</emu-alg>
</emu-clause>
</emu-clause>
Expand All @@ -33,9 +33,9 @@ contributors: "Jack Works"
<h1><dfn>CreateNumericRangeIterator</dfn>(_start_, _end_, _option_, _type_)</h1>
<emu-alg>
1. If Type(_start_) is not _type_, throw a *TypeError* exception.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually this step uses _type_ as a runtime ECMAScript value for comparison of typeof _start_ === _type_. Let me fix this.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Type abstract operation is not the same thing as the ECMAScript typeof operator. In particular, it returns the name of a type, not an ES language string (or a spec enum).

1. Assert: _type_ is *"number"* or *"bigint"*.
1. If _type_ is *"bigint"*, let _zero_ be *0n*, else let _zero_ be *0*.
1. If _type_ is *"bigint"*, let _one_ be *1n*, else let _one_ be *1*.
1. Assert: _type_ is ~number-range~ or ~bigint-range~.
1. If _type_ is ~bigint-range~, let _zero_ be *0n*, else let _zero_ be *0*.
1. If _type_ is ~bigint-range~, let _one_ be *1n*, else let _one_ be *1*.
1. Note: <emu-note type="editor">Allowing all kinds of number (number, bigint, decimals, ...) to range from a finite number to infinity.</emu-note>
1. If _end_ is not *+∞* or *-∞* and if Type(_end_) is not _type_, throw a *TypeError* exception.
1. If _start_ is *+∞* or *-∞*, throws a *RangeError* exception.
Expand Down