Editorial: add RequireInternalSlot abstract operation#1373
Merged
ljharb merged 1 commit intotc39:masterfrom Apr 10, 2019
Merged
Editorial: add RequireInternalSlot abstract operation#1373ljharb merged 1 commit intotc39:masterfrom
ljharb merged 1 commit intotc39:masterfrom
Conversation
4 tasks
Member
|
Cf. #354 . This seems like a simpler version of what was proposed there: slightly less readable/intuitive IMO, but also a smaller delta from the existing conventions. |
Member
Author
Member
|
I like this approach; it aids readability while not sacrificing explicitness. |
Member
|
Thinking about internal slots as first-class values which can be passed around (in the spec) makes my heard hurt a bit, but I don't see a fundamental problem it it. |
Member
|
@bakkot I know what you mean, but we already make liberal use of it with ObjectCreate. |
Member
So we do! I'd forgotten. |
zenparsing
approved these changes
Jan 29, 2019
Edit made with a regex search: Input: `( *)(1)\. If Type\(_([^_]+)_\) is not Object, throw a \*TypeError\* exception\.\n\11\. If _\3_ does not have (?:an?) \[\[([^\]]+)\]\] internal slot, throw a \*TypeError\* exception\.` Output: `$1$2. Perform ? RequireInternalSlot(_$3_, [[$4]]).`
ljharb
pushed a commit
to jmdyck/ecma262
that referenced
this pull request
May 2, 2019
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.
To me, this seems like a nice way to DRY up a common operation - asserting that a value is an Object with a given internal slot.
What are your thoughts on this? Is this too much indirection, or does this reduction in spec lines make it easier to read?
It was a pretty quick change, mostly a single regex operation, so I'm happy to close it if we don't think this is an improvement.