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

Use of [[value]] internal slot on ECMAScript language type. #1744

Closed
ursi opened this issue Oct 17, 2019 · 5 comments
Closed

Use of [[value]] internal slot on ECMAScript language type. #1744

ursi opened this issue Oct 17, 2019 · 5 comments
Labels
completion records Relates to completion records, and ? / ! notation. question

Comments

@ursi
Copy link

ursi commented Oct 17, 2019

25.6.1.3.2 step 9 is

Let then be Get(resolution, "then")

Get returns an ECMAScript language type, not a Property Attribute. However, the algorithm goes on to use then.[[value]]. As far as I can tell, ECMAScript language types don't have a [[value]] internal slot.

@devsnek
Copy link
Member

devsnek commented Oct 17, 2019

Get returns a Completion, which does have [[Value]].

@ljharb ljharb added completion records Relates to completion records, and ? / ! notation. question labels Oct 17, 2019
@ljharb ljharb closed this as completed Oct 17, 2019
@ursi
Copy link
Author

ursi commented Oct 17, 2019

uhg, the ? of course. I feel like I've trained myself to just filter those out. My bad.

Edit: Wait no. I don't think that's what does it. I'm just gonna read more.

@jmdyck
Copy link
Collaborator

jmdyck commented Oct 17, 2019

No, you're right, the ? (on step 3 of Get) indicates that Get can return an abrupt completion. The Promise Resolve Function's step 10 checks to see if it did, and if so, 10.a extracts that abrupt completion's [[Value]] field.

@ursi
Copy link
Author

ursi commented Oct 17, 2019

@jmdyck the real culprit was 5.2.3(.1). I was unaware that Return implicitly wrapped its value in NormalCompletion.

@michaelficarra
Copy link
Member

@ursi Yes, section 5.2.3.1, Implicit Completion Values, has been the source of much spec reader pain. Follow along at #497, #1572, #253, and others.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
completion records Relates to completion records, and ? / ! notation. question
Projects
None yet
Development

No branches or pull requests

5 participants