Repository navigation
Editorial: introduce figures with a description - #4003
Merged
Merged
Conversation
|
The rendered spec preview for this PR is available as a single page at https://tc39.es/ecma262/pr/4003 and as multiple pages at https://tc39.es/ecma262/pr/4003/multipage . |
linusg
approved these changes
Oct 23, 2026
| <p>Every object created by a constructor has an implicit reference (called the object's <em>prototype</em>) to the value of its constructor's *"prototype"* property. Furthermore, a prototype may have a non-*null* implicit reference to its prototype, and so on; this is called the <em>prototype chain</em>. When a reference is made to a property in an object, that reference is to the property of that name in the first object in the prototype chain that contains a property of that name. In other words, first the object mentioned directly is examined for such a property; if that object contains the named property, that is the property to which the reference refers; if that object does not contain the named property, the prototype for that object is examined next; and so on.</p> | ||
| <p>In a class-based object-oriented language, in general, state is carried by instances, methods are carried by classes, and inheritance is only of structure and behaviour. In ECMAScript, the state and methods are carried by objects, while structure, behaviour, and state are all inherited.</p> | ||
| <p>All objects that do not directly contain a particular property that their prototype contains share that property and its value. <emu-xref href="#figure-1"></emu-xref> illustrates this:</p> | ||
| <emu-figure id="figure-1" caption="Object/Prototype Relationships"> |
| <img alt="An image of lots of boxes and arrows." height="354" src="img/figure-1.svg" width="719"> | ||
| </emu-figure> | ||
| <p>In a class-based object-oriented language, in general, state is carried by instances, methods are carried by classes, and inheritance is only of structure and behaviour. In ECMAScript, the state and methods are carried by objects, while structure, behaviour, and state are all inherited.</p> | ||
| <p>All objects that do not directly contain a particular property that their prototype contains share that property and its value. Figure 1 illustrates this:</p> |
Member
There was a problem hiding this comment.
A hard-coded figure number?! 😱
michaelficarra
approved these changes
Oct 25, 2026
gibson042
approved these changes
Oct 26, 2026
nicolo-ribaudo
force-pushed
the
figure-intros
branch
2 times, most recently
from
October 26, 2026 16:38
6d08633 to
9303cba
Compare
Member
Author
|
Done, thanks @gibson042 for suggesting the wording. |
Co-authored-by: Nicolò Ribaudo <nribaudo@igalia.com> Co-authored-by: Richard Gibson <richard.gibson@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
tc39/ecmarkup#664 changes the position of figure captions to be below rather than above, meaning that some figures would suddenly appear in the text with no introduction:
This PR ensures that we always start with a paragraph introducing what the figure is about.