Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.
Sign upRuntime Semantics for MemberExpression do not conform to web reality(?) #1224
Comments
ljharb
added
question
web reality
labels
Jun 14, 2018
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
ljharb
Jun 14, 2018
Member
If you're correct here, then I wonder if it's something we could get browsers to change - i wouldn't expect the RHS to ever evaluate when evaluating the LHS throws.
|
If you're correct here, then I wonder if it's something we could get browsers to change - i wouldn't expect the RHS to ever evaluate when evaluating the LHS throws. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
|
See also #467. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
cpcallen
Jun 14, 2018
@ljharb: I agree, and had filed a bug against V8 about it. But since (in the process of preparing that bug report, I discovered that) other major browsers do the same, I thought I should inquire about it here too.
cpcallen
commented
Jun 14, 2018
|
@ljharb: I agree, and had filed a bug against V8 about it. But since (in the process of preparing that bug report, I discovered that) other major browsers do the same, I thought I should inquire about it here too. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
bakkot
Jun 14, 2018
Contributor
v8 already has a bug for it. (Edit: or rather, to be precise, they have a bug for evaluating the property name before doing the RequireObjectCoercible, though I don't know if anyone's noticed they also evaluate the RHS before doing the RequireObjectCoercible. The test in question tests both, but they fail at the property name part, since it comes first.)
|
v8 already has a bug for it. (Edit: or rather, to be precise, they have a bug for evaluating the property name before doing the RequireObjectCoercible, though I don't know if anyone's noticed they also evaluate the RHS before doing the RequireObjectCoercible. The test in question tests both, but they fail at the property name part, since it comes first.) |
added a commit
to NeilFraser/CodeCity
that referenced
this issue
Jun 14, 2018
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
erights
Jun 14, 2018
Huh. Any idea why the failure you point to at https://github.com/v8/v8/blob/80ec11d20d8d895f347a91eeff0d21e62441c6fb/test/test262/test262.status#L50 is in a section titled "MISSING ES6 FEATURES"? This seems like a clear non-conformance rather than a missing feature.
erights
commented
Jun 14, 2018
|
Huh. Any idea why the failure you point to at https://github.com/v8/v8/blob/80ec11d20d8d895f347a91eeff0d21e62441c6fb/test/test262/test262.status#L50 is in a section titled "MISSING ES6 FEATURES"? This seems like a clear non-conformance rather than a missing feature. |
added a commit
to NeilFraser/CodeCity
that referenced
this issue
Jun 15, 2018
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
littledan
Jun 24, 2018
Member
The last time we discussed reference evaluation issues, and all implementations mismatched the spec, @efaust just went and fixed SpiderMonkey, and we left the spec as is.
This time, it may be more complex and require reexamination--double evaluation (as we discussed previously) is somewhat of a tougher pill to swallow than these ordering issues (where the spec isn't "as much better" than implementation reality, and a full implementation of the Reference spec type may be difficult from implementation perspective).
So, I wouldn't mind reconsidering the evaluation order here.
@erights You can blame my sloppiness for not fixing up that comment when doing some of V8's test262 rolls. The comment doesn't mean anything in particular.
|
The last time we discussed reference evaluation issues, and all implementations mismatched the spec, @efaust just went and fixed SpiderMonkey, and we left the spec as is. This time, it may be more complex and require reexamination--double evaluation (as we discussed previously) is somewhat of a tougher pill to swallow than these ordering issues (where the spec isn't "as much better" than implementation reality, and a full implementation of the Reference spec type may be difficult from implementation perspective). So, I wouldn't mind reconsidering the evaluation order here. @erights You can blame my sloppiness for not fixing up that comment when doing some of V8's test262 rolls. The comment doesn't mean anything in particular. |
cpcallen commentedJun 13, 2018
I note that §12.3.2.1 Property Accessors: Runtime Semantics: Evaluation says:
MemberExpression
:MemberExpression.IdentifierNameAnd § 12.15.4 Assignment Operators: Runtime Semantics: Evaluation says:
AssignmentExpression
:LeftHandSideExpression=AssignmentExpressionAnd yet the following code logs
whoopsin at least V8 (6.7.288.46), Firefox (60.0.2) and Safari (11.1.1), even though RequireObjectCoercible is defined to throwTypeErrorwhen passedundefinedas its argument:The most plausible explanation for this apparent discrepancy is that I have misunderstood the spec in some way. Failing that, however: are these (several, prominent) implementations wrong, or should the spec be changed to reflect reality?