Skip to content

Conversation

tanhauhau
Copy link
Member

Fixes #5653

Before submitting the PR, please make sure you do the following

  • Prefix your PR title with [feat], [fix], [chore], or [docs].
  • This message body should clearly illustrate what problems it solves.
  • Ideally, include a test that fails without this PR but passes with it.

Tests

  • Run the tests with npm test and lint the project with npm run lint

@Conduitry
Copy link
Member

I'm a little confused about what this does and what the desired behavior here would even be.

Does this change make it so that ({ $foo } = some_object); will mean foo.set(some_object.$foo);?

This is kind of a weird edge case. I think that behavior probably makes the most sense.

@tanhauhau
Copy link
Member Author

Does this change make it so that ({ $foo } = some_object); will mean foo.set(some_object.$foo)

Yes

@Conduitry
Copy link
Member

When are we ever calling set_store_value with two arguments? I don't see where that would be happening. When I remove the line if (arguments.length === 2) value = ret; from this PR, all of the tests still pass. Do you see any problems with doing that?

@tanhauhau
Copy link
Member Author

tanhauhau commented Jul 24, 2021

oh good point, apparently we always call set_store_value with at least 3 arguments.

we optionally pass a 3rd argument for set_store_value until i changed it in #5416

@Conduitry Conduitry merged commit 9501ac6 into sveltejs:master Jul 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Destructuring into a store without rename syntax results in undefined behavior

4 participants