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

inadequate .[[Value]] after ReturnIfAbrupt in 15.2.1.20 #936

Open
kotarondo opened this Issue Jun 17, 2017 · 4 comments

Comments

Projects
None yet
3 participants
@kotarondo

kotarondo commented Jun 17, 2017

In the following Evaluation algorithm, sl.[[Value]] in the last line should be sl because sl is already a completion's [[Value]] after ReturnIfAbrupt(sl).

15.2.1.20 Runtime Semantics: Evaluation
ModuleItemList: ModuleItemList ModuleItem
 1. Let sl be the result of evaluating ModuleItemList.
 2. ReturnIfAbrupt(sl).
 3. Let s be the result of evaluating ModuleItem.
 4. Return Completion(UpdateEmpty(s, sl.[[Value]])).
@ljharb

This comment has been minimized.

Show comment
Hide comment
@ljharb

ljharb Jun 17, 2017

Member

Doesn't ReturnIfAbrupt(sl) become the value? I don't think it mutates the fictional sl binding.

Member

ljharb commented Jun 17, 2017

Doesn't ReturnIfAbrupt(sl) become the value? I don't think it mutates the fictional sl binding.

@kotarondo

This comment has been minimized.

Show comment
Hide comment
@kotarondo

kotarondo Jun 17, 2017

The Definition of ReturnIfAbrupt:

5.2.3.3 ReturnIfAbrupt
Algorithms steps that say or are otherwise equivalent to:

ReturnIfAbrupt(argument).
mean the same thing as:

If argument is an abrupt completion, return argument.
Else if argument is a Completion Record, let argument be argument.[[Value]].

In above case, step 2 means:

If sl is an abrupt completion, return sl.
Else if sl is a Completion Record, let sl be sl.[[Value]].

kotarondo commented Jun 17, 2017

The Definition of ReturnIfAbrupt:

5.2.3.3 ReturnIfAbrupt
Algorithms steps that say or are otherwise equivalent to:

ReturnIfAbrupt(argument).
mean the same thing as:

If argument is an abrupt completion, return argument.
Else if argument is a Completion Record, let argument be argument.[[Value]].

In above case, step 2 means:

If sl is an abrupt completion, return sl.
Else if sl is a Completion Record, let sl be sl.[[Value]].
@ljharb

This comment has been minimized.

Show comment
Hide comment
@ljharb

ljharb Jun 17, 2017

Member

Ah, fair point. That seems like a confusing way for the spec to be worded, but given that, I think you are correct.

Member

ljharb commented Jun 17, 2017

Ah, fair point. That seems like a confusing way for the spec to be worded, but given that, I think you are correct.

@jmdyck

This comment has been minimized.

Show comment
Hide comment
@jmdyck

jmdyck Jun 18, 2017

Collaborator

That seems like a confusing way for the spec to be worded

(I think it would be less confusing with the proposal of Issue #497.)

Collaborator

jmdyck commented Jun 18, 2017

That seems like a confusing way for the spec to be worded

(I think it would be less confusing with the proposal of Issue #497.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment