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

Is null[{ toString: () => { console.log('hit') } }] supposed to hit the console.log? #2659

Closed
bakkot opened this issue Feb 10, 2022 · 5 comments

Comments

@bakkot
Copy link
Contributor

bakkot commented Feb 10, 2022

#2267 changed the sequencing of the RequireObjectCoercible-on-base / ToString-on-property for member assignments, like a[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 print hit before throwing:

Of engines I have on hand, only ChakraCore implements this behavior.

cc @codehag

@h2oche
Copy link
Contributor

h2oche commented Mar 20, 2022

We can also observe this behavior with our implementation ESMeta, which strictly follows the spec. Currently, spec and tests are diverged.

@jedel1043
Copy link

jedel1043 commented May 6, 2023

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!

@ptomato
Copy link
Contributor

ptomato commented Apr 15, 2024

Is this actually the same issue as #3295?

@bakkot
Copy link
Contributor Author

bakkot commented Apr 15, 2024

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.

@bakkot bakkot added the editor call to be discussed in the next editor call label Apr 15, 2024
rkirsling added a commit to rkirsling/test262 that referenced this issue Apr 18, 2024
rkirsling added a commit to rkirsling/test262 that referenced this issue Apr 18, 2024
rkirsling added a commit to rkirsling/test262 that referenced this issue Apr 18, 2024
ptomato pushed a commit to tc39/test262 that referenced this issue Apr 22, 2024
@bakkot bakkot removed the editor call to be discussed in the next editor call label May 15, 2024
@bakkot
Copy link
Contributor Author

bakkot commented May 30, 2024

Fixed by #3307.

@bakkot bakkot closed this as completed May 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants