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

Regression: 'state' as a computed property name throws an exception #1012

Closed
ChrisTalman opened this issue Dec 12, 2017 · 1 comment · Fixed by #1019
Closed

Regression: 'state' as a computed property name throws an exception #1012

ChrisTalman opened this issue Dec 12, 2017 · 1 comment · Fixed by #1019
Labels

Comments

@ChrisTalman
Copy link

Svelte 1.47.1 seems to trip up when it encounters a computed property with the name state.

This is demonstrated here.

I had been using a previous version of Svelte, but when I updated to 1.47.1, this exception appeared.

Obviously, state means something to Svelte internally, but it was possible to use this as a property name prior to 1.47.1 (or an earlier version), and it is useful to be able to do.

I have also included a stack trace below if that is of any help.

Stack Trace

Uncaught TypeError: state is not a function
at Component._recompute (app.js:42181)
at new Component (app.js:42151)
at create_main_fragment (app.js:95787)
at new Component (app.js:96512)
at create_if_block (app.js:95365)
at Object.update [as p] (app.js:95269)
at Component._set (app.js:8411)
at Object.update [as p] (app.js:112328)
at Object.update [as p] (app.js:112272)
at Component._set (app.js:8411)

@ChrisTalman ChrisTalman changed the title state is not a function Regression: state as a property name throws an exception Dec 12, 2017
@ChrisTalman ChrisTalman changed the title Regression: state as a property name throws an exception Regression: state as a computed property name throws an exception Dec 12, 2017
@ChrisTalman ChrisTalman changed the title Regression: state as a computed property name throws an exception Regression: 'state' as a computed property name throws an exception Dec 12, 2017
Rich-Harris added a commit that referenced this issue Dec 13, 2017
deconflict computed properties with arguments to _recompute
@Rich-Harris
Copy link
Member

Looks like that was lurking there a while. Fixed in 1.47.2. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants