Skip to content

Conversation

jmdyck
Copy link
Collaborator

@jmdyck jmdyck commented Nov 10, 2021

Use consistent prose when the initial values of two intrinsic-properties are the same object.

@ljharb ljharb requested review from syg, michaelficarra, bakkot and a team November 10, 2021 16:55
@michaelficarra
Copy link
Member

Within this PR, we are still inconsistent about whether we refer to just the property name (keys/@@iterator/trimLeft/trimRight) or we refer to its whole position (Date.prototype.toGMTString/Number.parseInt/Number.parseFloat). I think that should be made consistent as well.

@jmdyck
Copy link
Collaborator Author

jmdyck commented Nov 11, 2021

Within this PR, we are still inconsistent about whether we refer to just the property name (keys/@@iterator/trimLeft/trimRight) or we refer to its whole position (Date.prototype.toGMTString/Number.parseInt/Number.parseFloat). I think that should be made consistent as well.

I agree, but that inconsistency is much wider than the few spots addressed by this PR, so I was going to deal with it separately. In fact, I'll open an issue to start the discussion.

Copy link
Contributor

@gibson042 gibson042 left a comment

Choose a reason for hiding this comment

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

Should this also align the rest of the variants?

$ grep -o 'initial value of .* property' spec.html | \
  sed 's/property.*/property/; s/[*]"[^*"]*"[*]/*"…"*/; s/@@[[:graph:]]*/@@…/' | \
  sort | uniq -c
      1 initial value of the async generator function's *"…"* property
      1 initial value of the @@… data property
      1 initial value of the function's `name` property
      1 initial value of the function's *"…"* property
      1 initial value of the generator function's *""* property
     31 initial value of the @@… property
     40 initial value of the *""* property
      1 initial value of the %TypedArray%`.prototype.toString` data property

I'm thinking it would involve replacing «@@… data property» with «@@… property» and «function's `name` property» with «function's *"name"* property» (the other «[$type] function's *"…"* property» patterns refer to prototype initialization and seem fine to me).

spec.html Outdated
@@ -47397,7 +47397,7 @@ <h1>Date.prototype.toGMTString ( )</h1>
<emu-note>
<p>The `toUTCString` method is preferred. The `toGMTString` method is provided principally for compatibility with old code.</p>
</emu-note>
<p>The function object that is the initial value of `Date.prototype.toGMTString` is the same function object that is the initial value of `Date.prototype.toUTCString`.</p>
<p>The initial value of the `Date.prototype.toGMTString` property is %Date.prototype.toUTCString%, defined in <emu-xref href="#sec-date.prototype.toutcstring"></emu-xref>.</p>
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
<p>The initial value of the `Date.prototype.toGMTString` property is %Date.prototype.toUTCString%, defined in <emu-xref href="#sec-date.prototype.toutcstring"></emu-xref>.</p>
<p>The initial value of the *"toGMTString"* property is %Date.prototype.toUTCString%, defined in <emu-xref href="#sec-date.prototype.toutcstring"></emu-xref>.</p>

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Whether to use the "full name" or just the property key is the same point that @michaelficarra brought up. Again, I'd like to defer that to a bigger PR (after some discussion about what's wanted).

Copy link
Contributor

Choose a reason for hiding this comment

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

I agree in general, but in this specific case I think it makes sense to match the nearby sections right now (specifically the preceding String.prototype.trimLeft and String.prototype.trimRight, which this PR updates to «The initial value of the *"trim{Left,Right}"* property is…»).

Copy link
Contributor

Choose a reason for hiding this comment

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

I agree with @gibson042. While it's true that there's lots of other inconsistency remaining to be fixed, it is also true that as of this PR there are 44 uses of precise phrase "<p>The initial value of the X property", and of them only Number.parseFloat, Number.parseInt, %TypedArray%`.prototype.toString`, and Date.prototype.toGMTString are written out as full paths, and all of those uses are introduced by this PR. Seems best to just make those four consistent with the other uses of that phrase for the moment, and possibly change them all as part of #2576.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Hm. Maybe I'll just pause this PR until #2576 makes some progress on question (1).

Copy link
Contributor

@bakkot bakkot Nov 13, 2021

Choose a reason for hiding this comment

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

Ehhh, I'd prefer to just land this, with the specific inconsistency mentioned above fixed, and then deal with #2576 later. I'm happy to push up a commit to this branch addressing the above comment if you'd prefer not to do it yourself.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Nah, you wore me down. I'll push a commit.

spec.html Outdated
@@ -39220,7 +39220,7 @@ <h1>%TypedArray%.prototype.toLocaleString ( [ _reserved1_ [ , _reserved2_ ] ] )<

<emu-clause id="sec-%typedarray%.prototype.tostring">
<h1>%TypedArray%.prototype.toString ( )</h1>
<p>The initial value of the %TypedArray%`.prototype.toString` data property is the same built-in function object as the `Array.prototype.toString` method defined in <emu-xref href="#sec-array.prototype.tostring"></emu-xref>.</p>
<p>The initial value of the %TypedArray%`.prototype.toString` property is %Array.prototype.toString%, defined in <emu-xref href="#sec-array.prototype.tostring"></emu-xref>.</p>
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
<p>The initial value of the %TypedArray%`.prototype.toString` property is %Array.prototype.toString%, defined in <emu-xref href="#sec-array.prototype.tostring"></emu-xref>.</p>
<p>The initial value of the *"toString"* property is %Array.prototype.toString%, defined in <emu-xref href="#sec-array.prototype.tostring"></emu-xref>.</p>

The initial value of the *"toGMTString"* property is %Date.prototype.toUTCString%, defined in .

@jmdyck
Copy link
Collaborator Author

jmdyck commented Nov 11, 2021

Should this also align the rest of the variants?

If by "this" you mean "this PR", then no, I intentionally made this PR very narrowly scoped. But yes, I'd like those variants to be made consistent, and I'll do the job if I can get a sense of how the editors would like things aligned. See Issue #2576.

$ grep -o 'initial value of .* property' spec.html | ...

Note that that doesn't find all variants, because some don't use the word "initial" and some don't use the word "value" and some don't use the word "property".

Copy link
Member

@michaelficarra michaelficarra left a comment

Choose a reason for hiding this comment

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

It's an improvement, and I'm looking forward to your PR that further refines this phrasing.

@jmdyck jmdyck force-pushed the same-value-properties branch from 76ef273 to 12d1e95 Compare November 13, 2021 22:49
@bakkot bakkot added the ready to merge Editors believe this PR needs no further reviews, and is ready to land. label Nov 16, 2021
Use consistent prose when the initial values of two intrinsic-properties are the same object.

In the sentences affected by this PR, refer to properties by just the final property name rather than by "full paths".

That is, change:
- `Number.parseFloat` to *"parseFloat"*
- `Number.parseInt` to *"parseInt"*
- %TypedArray%`.prototype.toString` to *"toString"*
- `Date.prototype.toGMTString` to *"toGMTString"*

This increases consistency among sentences of this particular form.

(But note that they're a small fraction of a large class of sentences
being considered by issue tc39#2576, whose resolution could
'overturn' this choice, or other choices made in this PR)
@ljharb ljharb force-pushed the same-value-properties branch from 12d1e95 to e06c80c Compare November 18, 2021 07:19
@ljharb ljharb merged commit e06c80c into tc39:main Nov 18, 2021
@jmdyck jmdyck deleted the same-value-properties branch November 18, 2021 21:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
editorial change establishes editorial conventions ready to merge Editors believe this PR needs no further reviews, and is ready to land.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants