Skip to content
This repository has been archived by the owner on Jan 25, 2022. It is now read-only.

Normative Optional: Add WeakRef.prototype.constructor #133

Merged
merged 1 commit into from
Jun 4, 2019
Merged
Show file tree
Hide file tree
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
13 changes: 13 additions & 0 deletions spec/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,19 @@
copyright: proposal
contributors: Dean Tribble, Till Schneidereit, Sathya Gunasekaran
</pre>
<style>
[normative-optional] {
Copy link
Contributor

Choose a reason for hiding this comment

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

Could you send me a screenshot of how the normal optional text below gets rendered with these stylings?

Copy link
Member Author

Choose a reason for hiding this comment

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

image

Copy link
Contributor

Choose a reason for hiding this comment

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

Excellent! I am all in favor. Thanks.

border-left: 5px solid #ff6600;
padding: .5em;
display: block;
background: #ffeedd;
}
[normative-optional]:before {
display: block;
color: #884400;
content: "NORMATIVE OPTIONAL";
}
</style>

<emu-import href="./weak-ref.html"></emu-import>
<emu-import href="./finalization-group.html"></emu-import>
Expand Down
12 changes: 12 additions & 0 deletions spec/weak-ref.html
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,18 @@ <h1>Properties of the WeakRef Prototype Object</h1>
<li>does not have a [[Target]] internal slot.</li>
</ul>

<emu-clause id="sec-weak-ref.prototype.constructor" normative-optional>
<h1>WeakRef.prototype.constructor</h1>

<p>The initial value of `WeakRef.prototype.constructor` is the intrinsic object %WeakRef%.</p>

<p>This property has the attributes { [[Writable]]: *false*, [[Enumerable]]: *false*, [[Configurable]]: *true* }.</p>

<emu-note type="editor">
This section is to be treated identically to the "Annex B" of ECMA-262, but to be written in-line with the main specification.
Copy link
Member

@ljharb ljharb Jun 4, 2019

Choose a reason for hiding this comment

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

can you elaborate on this conclusion? I’m a bit confused how “reform” seems like just an alternative editorial form of the same semantics.

Copy link
Member Author

Choose a reason for hiding this comment

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

The idea here is to put Annex B inline to make it easier to read. We do this in ECMA-402. We discussed this earlier today in the TC39 meeting; delegates can see the draft notes. Do you have any concerns with this idea?

Copy link
Member

Choose a reason for hiding this comment

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

It seems fine, but that's a pretty massive editorial change discussed with no editors present, and wasn't what I expected from a slideless presentation called "reform".

Reviewing the notes gives me a bit more clarity, but I'd still hope to see a few examples of inline normative optional land in the main spec before a proposal added one (that shouldn't block this PR ofc)

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, the plan is that I'll file an issue in ecma262 describing the plan, and we'll work from there in PRs. This PR can be thought of as a really early first draft, editorially; we just need to get it off the ground here and have the observable semantics specified.

</emu-note>
</emu-clause>

<emu-clause id="sec-weak-ref.prototype.deref">
<h1>WeakRef.prototype.deref ( )</h1>
<p>The following steps are taken:</p>
Expand Down