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: define and use improved intrinsics notation #1376

Merged
merged 1 commit into from
Aug 7, 2019

Conversation

ljharb
Copy link
Member

@ljharb ljharb commented Dec 18, 2018

Per editors' group discussion, separating this out from #1314.

The intention here is to prevent unbounded future growth of the intrinsics table, while also making intrinsic references slightly more readable/intuitive by making them more closely mirror the JS you'd use to access them (in an unmodified realm).

This ideally would be coupled with a change in ecmarkup to auto-link intrinsic syntax to the value in question, for even easier consumption.

Closes #1377. Closes #1105.

spec.html Outdated Show resolved Hide resolved
ljharb added a commit to ljharb/ecma262 that referenced this pull request Dec 18, 2018
spec.html Outdated Show resolved Hide resolved
@jmdyck
Copy link
Collaborator

jmdyck commented Jan 14, 2019

Rather than adding (for instance) i.e., %ArrayBuffer.prototype% in the third column ("ECMAScript Language Association"), I think it would make more sense to add %ArrayBuffer.prototype% in the first column ("Intrinsic Name").

@ljharb
Copy link
Member Author

ljharb commented Jan 14, 2019

@jmdyck there are potentially other specs that reference the original intrinsic name.

@domenic
Copy link
Member

domenic commented Jan 14, 2019

The only such specs should be HTML, Web IDL, and Streams, which are all living and can be updated. So indeed, if you want to remove all %XPrototype% entries entirely, we could probably get away with that, with a bit of extra work.

@ljharb
Copy link
Member Author

ljharb commented Jan 14, 2019

@domenic definitely; my hope is to land this, then I'll go file PRs on those specs to update them, and then I can come back here and file a final one to "clean up" all the no-longer-necessary explicit intrinsics.

@jmdyck
Copy link
Collaborator

jmdyck commented Jan 14, 2019

@jmdyck there are potentially other specs that reference the original intrinsic name.

They can continue to do so, as I didn't suggest removing the original names. I specifically said add the new name to column 1.

@Ms2ger
Copy link
Contributor

Ms2ger commented May 14, 2019

What's the status here?

spec.html Outdated
@@ -1689,7 +1689,7 @@ <h2>[[Construct]] ( )</h2>
<emu-clause id="sec-well-known-intrinsic-objects">
<h1>Well-Known Intrinsic Objects</h1>
<p>Well-known intrinsics are built-in objects that are explicitly referenced by the algorithms of this specification and which usually have realm-specific identities. Unless otherwise specified each intrinsic object actually corresponds to a set of similar objects, one per realm.</p>
<p>Within this specification a reference such as %name% means the intrinsic object, associated with the current realm, corresponding to the name. Determination of the current realm and its intrinsics is described in <emu-xref href="#sec-execution-contexts"></emu-xref>. The well-known intrinsics are listed in <emu-xref href="#table-7"></emu-xref>.</p>
<p>Within this specification a reference such as %name% means the intrinsic object, associated with the current realm, corresponding to the name. A reference such as %name.a.b% means, as if the "b" property of the "a" property of the intrinsic object %name% was accessed prior to any ECMAScript code being evaluated. Determination of the current realm and its intrinsics is described in <emu-xref href="#sec-execution-contexts"></emu-xref>. The well-known intrinsics are listed in <emu-xref href="#table-7"></emu-xref>.</p>
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
<p>Within this specification a reference such as %name% means the intrinsic object, associated with the current realm, corresponding to the name. A reference such as %name.a.b% means, as if the "b" property of the "a" property of the intrinsic object %name% was accessed prior to any ECMAScript code being evaluated. Determination of the current realm and its intrinsics is described in <emu-xref href="#sec-execution-contexts"></emu-xref>. The well-known intrinsics are listed in <emu-xref href="#table-7"></emu-xref>.</p>
<p>Within this specification a reference such as %name% means the intrinsic object, associated with the current realm, corresponding to the name. A reference such as %name.a.b% means the object that is the "b" property of the object that is the "a" property of the intrinsic object %name%, before any ECMAScript code is evaluated. Determination of the current realm and its intrinsics is described in <emu-xref href="#sec-execution-contexts"></emu-xref>. The well-known intrinsics are listed in <emu-xref href="#table-7"></emu-xref>.</p>

@jmdyck
Copy link
Collaborator

jmdyck commented May 14, 2019

Tangential thought for the future (not a problem for this PR):

@ljharb

my hope is to [...] come back here and file a final one to "clean up" all the no-longer-necessary explicit intrinsics.

Note that if you remove table rows for things that can be expressed as %Foo.X%, that will raise a question about the definition of "well-known intrinsic". There are currently two definitions: "built-in objects that are explicitly referenced by the algorithms of this specification", and "the objects listed in Table 7", and I think they currently agree. But if an algorithm references %Foo.X% and there's no row for %Foo.X% in Table 7, then the definitions disagree.

You could resolve it either way (i.e., pick either to become the "true" definition), but you'd need to alter the other so that it no longer sounds like a definition.

@jmdyck
Copy link
Collaborator

jmdyck commented May 14, 2019

CreateIntrinsics creates _realmRec_.[[Intrinsics]] with a field for each intrinsic listed in Table 7, but this PR will allow specs to refer to intrinsics that are not listed in Table 7, so it's not clear how such references would be 'resolved' (in the specification model). It seems like [[Intrinsics]] would need a field for every intrinsic, whether listed in Table 7 or not, which will require some change of wording.

(This is related to a comment from @domenic in #1105.)

@ljharb ljharb deleted the intrinsic_dots branch August 7, 2019 22:27
@jmdyck jmdyck mentioned this pull request Aug 8, 2019
jmdyck added a commit to jmdyck/ecma262 that referenced this pull request Sep 9, 2019
In Editorial commit f1b22ef (tc39#1376):

- "%<var>NativeError</var>Prototype%" changed to "%NativeErrorPrototype%",
  which doesn't make sense, because there's no such intrinsic.

- "%<var>TypedArray</var>Prototype%" changed to "%TypedArrayPrototype%",
  which would be a change in semantics, which shouldn't happen in an Editorial commit.

So these changes were presumably mistakes.
jmdyck added a commit to jmdyck/ecma262 that referenced this pull request Sep 9, 2019
Commit f1b22ef (tc39#1376) changed 2 occurrences of
  "%AsyncIteratorPrototype%
to
  "%AsyncIterator.prototype%
but the latter assumes a well-known intrinsic named "%AsyncIterator%",
which doesn't exist.

This commit changes them back.
jmdyck added a commit to jmdyck/ecma262 that referenced this pull request Sep 9, 2019
Commit f1b22ef (tc39#1376) changed lots of intrinsic-names
from old-style to new-style.

But these two should have stayed old-style,
so switch them back.

(See tc39#1636 (comment))
jmdyck added a commit to jmdyck/ecma262 that referenced this pull request Sep 9, 2019
Commit f1b22ef (tc39#1376) changed lots of intrinsic-references
from old-style to new-style. This commit changes a few more.
ljharb pushed a commit to jmdyck/ecma262 that referenced this pull request Sep 16, 2019
In PR tc39#1571:

https://github.com/tc39/ecma262/pull/1571/files#diff-3540caefa502006d8a33cb1385720803L19940
removed the step
"Assert: _constructorInfo_ is not an abrupt completion."
but didn't insert the equivalent "!" on the previous line.

https://github.com/tc39/ecma262/pull/1571/files#diff-3540caefa502006d8a33cb1385720803L23362
removed a ReturnIfAbrupt step,
but didn't insert the equivalent '?' in the previous line.

---

Commit f1b22ef (tc39#1376) changed 2 occurrences of
  "%AsyncIteratorPrototype%
to
  "%AsyncIterator.prototype%
but the latter assumes a well-known intrinsic named "%AsyncIterator%",
which doesn't exist.

This commit changes them back.

---

Commit f1b22ef (tc39#1376) changed lots of intrinsic-names
from old-style to new-style.

But these two should have stayed old-style,
so switch them back.

(See tc39#1636 (comment))
ljharb pushed a commit to jmdyck/ecma262 that referenced this pull request Sep 16, 2019
In Editorial commit f1b22ef (tc39#1376):

- "%<var>NativeError</var>Prototype%" changed to "%NativeErrorPrototype%",
  which doesn't make sense, because there's no such intrinsic.

- "%<var>TypedArray</var>Prototype%" changed to "%TypedArrayPrototype%",
  which would be a change in semantics, which shouldn't happen in an Editorial commit.

So these changes were presumably mistakes.
ljharb pushed a commit to jmdyck/ecma262 that referenced this pull request Sep 16, 2019
Commit f1b22ef (tc39#1376) changed lots of intrinsic-references
from old-style to new-style. This commit changes a few more.
domenic pushed a commit to whatwg/html that referenced this pull request Jun 18, 2020
Follows tc39/ecma262#1376, and prevents problems
in the future when the non-dotted forms are deleted.
domenic pushed a commit to whatwg/infra that referenced this pull request Jun 18, 2020
Follows tc39/ecma262#1376, and prevents problems
in the future when the non-dotted forms are deleted.
domenic pushed a commit to whatwg/webidl that referenced this pull request Jun 18, 2020
Follows tc39/ecma262#1376, and prevents problems
in the future when the non-dotted forms are deleted.

Closes #897.
@ghost ghost deleted a comment Jun 22, 2020
ljharb added a commit to tc39/ecma402 that referenced this pull request Jul 9, 2020
Since tc39/ecma262#1376, the dotted form of intrinsic notation is preferred.

Additionally, tc39/ecma262#2056 intends to remove these legacy intrinsics, once it is non-normative to do so. HTML has already been updated to no longer use them.
ljharb added a commit to tc39/ecma402 that referenced this pull request Jul 11, 2020
Since tc39/ecma262#1376, the dotted form of intrinsic notation is preferred.

Additionally, tc39/ecma262#2056 intends to remove these legacy intrinsics, once it is non-normative to do so. HTML has already been updated to no longer use them.
leobalter pushed a commit to tc39/ecma402 that referenced this pull request Aug 21, 2020
Since tc39/ecma262#1376, the dotted form of intrinsic notation is preferred.

Additionally, tc39/ecma262#2056 intends to remove these legacy intrinsics, once it is non-normative to do so. HTML has already been updated to no longer use them.
mfreed7 pushed a commit to mfreed7/html that referenced this pull request Sep 11, 2020
Follows tc39/ecma262#1376, and prevents problems
in the future when the non-dotted forms are deleted.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants