-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
various editorial changes for comparisons #2877
Conversation
033ca34
to
7953e98
Compare
46f92c7
to
e64da4d
Compare
6875d77
to
76dcacc
Compare
8bcb56b
to
5bfe4b6
Compare
cdd1dc1
to
288c70c
Compare
FYI I'm done with my review of the spec for this PR. All changes should now be included and rebased on |
spec.html
Outdated
1. Set _k_ to _k_ + 1. | ||
1. Set _n_ to _n_ + 1. | ||
1. Else, | ||
1. If _srcType_ is _targetType_, then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note to reviewers: I'm just swapping the positive/negative branches here.
288c70c
to
4de8aab
Compare
Okay that was actually easier than I expected. This is ready for review. |
4de8aab
to
a54475d
Compare
a54475d
to
445a7fe
Compare
c588eb0
to
1f67a0d
Compare
445a7fe
to
5dfe50c
Compare
resolved conflicts |
5dfe50c
to
f7f787c
Compare
@syg may not care to review again, since we've talked about all the decisions, but we should check before landing. |
Re-doing my analysis from Oct 17... Composing a condition from sub-conditions... ... when there are only 2 sub-conditions:
... when there are 3+ sub-conditions:
(And while I'm here, conditions that mix operators without parens:
) Testing whether or not a value matches some list of descriptions (e.g., ... when there are only 2 descriptions:
... when there are 3+ descriptions:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some things I didn't put into PR #2970.
spec.html
Outdated
@@ -35337,7 +35343,7 @@ <h1> | |||
1. Assert: _c_ is a MatcherContinuation. | |||
1. Let _Input_ be _x_'s _input_. | |||
1. Let _e_ be _x_'s _endIndex_. | |||
1. If _e_ = 0, or if _rer_.[[Multiline]] is *true* and the character _Input_[_e_ - 1] is one of |LineTerminator|, then | |||
1. If _e_ = 0, or if _rer_.[[Multiline]] is *true* and the character _Input_[_e_ - 1] is matched by |LineTerminator|, then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree that is one of |LineTerminator|
should be changed, but this use of "is matched by" is odd. Normally, "X is matched by |Foo|" means that:
- X is a chunk of source text, and
- X (or, more likely, some larger source text that contains X) has been parsed according to a grammar, resulting in a |Foo| Parse Node that corresponds to X.
But neither of those points is true here.
Maybe:
1. If _e_ = 0, or if _rer_.[[Multiline]] is *true* and the character _Input_[_e_ - 1] is matched by |LineTerminator|, then | |
1. If _e_ = 0, or if _rer_.[[Multiline]] is *true* and the character _Input_[_e_ - 1] is one of U+000A (LINE FEED), U+000D (CARRIAGE RETURN), U+2028 (LINE SEPARATOR), or U+2029 (PARAGRAPH SEPARATOR), then |
spec.html
Outdated
@@ -35352,7 +35358,7 @@ <h1> | |||
1. Let _Input_ be _x_'s _input_. | |||
1. Let _e_ be _x_'s _endIndex_. | |||
1. Let _InputLength_ be the number of elements in _Input_. | |||
1. If _e_ = _InputLength_, or if _rer_.[[Multiline]] is *true* and the character _Input_[_e_] is one of |LineTerminator|, then | |||
1. If _e_ = _InputLength_, or if _rer_.[[Multiline]] is *true* and the character _Input_[_e_] is matched by |LineTerminator|, then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(ditto previous comment)
spec.html
Outdated
@@ -35916,7 +35922,7 @@ <h1> | |||
<emu-alg> | |||
1. Let _basicWordChars_ be the CharSet containing every character in the ASCII word characters. | |||
1. Let _extraWordChars_ be the CharSet containing all characters _c_ such that _c_ is not in _basicWordChars_ but Canonicalize(_rer_, _c_) is in _basicWordChars_. | |||
1. Assert: _extraWordChars_ is empty unless _rer_.[[Unicode]] and _rer_.[[IgnoreCase]] are both *true*. | |||
1. Assert: _extraWordChars_ is empty unless _rer_.[[Unicode]] is *true* and _rer_.[[IgnoreCase]] is *true*. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are several remaining occurrences of "X and Y are both Z", so it's unclear why this particular one would be changed.
56c36a7
to
f36a44e
Compare
I don't love the Can I suggest |
Note that there's a call to
Those all work. The algorithm doesn't currently use |
58a0f40
to
40fc334
Compare
Co-authored-by: Michael Dyck <[email protected]> Co-authored-by: Michael Ficarra <[email protected]>
40fc334
to
f1fbcc5
Compare
This one is debatable. I mostly did it for my convenience, but I think PR tc39#2877 also preferred some similar expansions.
This one is debatable. I mostly did it for my convenience, but I think PR tc39#2877 also preferred some similar expansions.
Extracted from #2821. Fixes #2794.
Editorial choices included in this PR
=
,≠
,<
,≤
,>
, and≥
for mathematical value and bigint comparisons (except in asserts); prefer=
over≠
is
,is not
,<
,≤
,>
, and≥
for number comparisonsSameValue(..., ...) is *true*
for equality comparison of symbols (except well-known) / objects / unknown ECMAScript language valuesis
andis not
for equality comparison of all other values, including booleans, strings, well-known symbols, null, undefined, enums, etc; avoid "is different from" or "is the same as"_list_ contains _element_
or_list_ does not contain _element_
, not_element_ is an element of _list_
or_element_ is in _list_
the value of _a_
; just use_a_
Other editorial choices (still to do, not as part of this PR)
a
/an
/a new
for creating and referencing values with identitythe
for referencing values without identity