-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Is null[{ toString: () => { console.log('hit') } }]
supposed to hit the console.log
?
#2659
Comments
We can also observe this behavior with our implementation ESMeta, which strictly follows the spec. Currently, spec and tests are diverged. |
Opened a couple of PRs on the test262 repo that fixes the corresponding tests on either case: preserve the new semantics or rollback to the old behaviour. PRs will be waiting for consensus on this. Hopefully this reactivates the issue's discussion! |
Is this actually the same issue as #3295? |
Related, but not identical - that issue is much older than this one, which was only introduced in #2267 (I think). That said, I think the same PR might fix this as well. I'll have to walk through it carefully to confirm. |
Ensure that the following cases are covered: - tc39/ecma262#3295 (comment) - tc39/ecma262#2659 (comment)
Ensure that the following cases are covered: - tc39/ecma262#3295 (comment) - tc39/ecma262#2659 (comment)
Ensure that the following cases are covered: - tc39/ecma262#3295 (comment) - tc39/ecma262#2659 (comment)
Ensure that the following cases are covered: - tc39/ecma262#3295 (comment) - tc39/ecma262#2659 (comment)
Fixed by #3307. |
#2267 changed the sequencing of the
RequireObjectCoercible
-on-base /ToString
-on-property for member assignments, likea[b] = c
.As I read the spec, it also changed the semantics for
null[{ toString: () => { console.log('hit') } }]
, which by my reading is now supposed to printhit
before throwing:RequireObjectCoercible
happens only during theGetValue
call happens in the Evaluation semantics for ExpressionStatement,ToString
has already happened,ToPropertyKey
callEvaluatePropertyAccessWithExpressionKey
MemberExpression : MemberExpression [ Expression ]
.Of engines I have on hand, only ChakraCore implements this behavior.
cc @codehag
The text was updated successfully, but these errors were encountered: