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: Explicitly define default value of 'internalSlotsList' in OrdinaryCreateFromConstructor #2379

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

h2oche
Copy link
Contributor

@h2oche h2oche commented Apr 9, 2021

In 10.1.13 OrdinaryCreateFromConstructor, it might be better to explicitly define default value of internalSlotsList when it is not provided.

@h2oche h2oche force-pushed the OrdinaryCreateFromConstructor branch from 85aad5f to 8c4fe31 Compare April 9, 2021 08:26
@h2oche h2oche force-pushed the OrdinaryCreateFromConstructor branch from 8c4fe31 to 787d2ee Compare April 9, 2021 08:32
@@ -10569,6 +10569,7 @@ <h1>OrdinaryCreateFromConstructor ( _constructor_, _intrinsicDefaultProto_ [ , _
<emu-alg>
1. Assert: _intrinsicDefaultProto_ is a String value that is this specification's name of an intrinsic object. The corresponding object must be an intrinsic that is intended to be used as the [[Prototype]] value of an object.
1. Let _proto_ be ? GetPrototypeFromConstructor(_constructor_, _intrinsicDefaultProto_).
1. If _internalSlotsList_ is not present, set _internalSlotsList_ to a new empty List.
Copy link
Member

Choose a reason for hiding this comment

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

The prose for this AO already says “ If internalSlotsList is not provided, a new empty List is used.”.

Copy link
Contributor

Choose a reason for hiding this comment

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

While that's true, I think it's nicer to have it in the algorithm steps as well. There's a few other places we do this, like in Abstract Relational Comparison, and I think we should change all of them.

Copy link
Member

Choose a reason for hiding this comment

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

In that case, should it be removed from the prose?

Copy link
Contributor

Choose a reason for hiding this comment

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

I think it's fine to keep it in the prose as well - it's an accurate and potentially useful description of the behavior of the algorithm.

Copy link
Member

Choose a reason for hiding this comment

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

would you expect, then, that it'd be duplicated in prose and an algorithm step in every case where there's a default value on an optional AO argument?

Copy link
Contributor

Choose a reason for hiding this comment

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

No, the preambles are just general descriptions of the behavior; they don't need to all give exactly the same level of details.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants