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

Fixes #420 #421

Merged
merged 2 commits into from
Mar 29, 2017
Merged

Conversation

dxlbnl
Copy link
Contributor

@dxlbnl dxlbnl commented Mar 29, 2017

fixes #420, still have to make a test for this

@dxlbnl
Copy link
Contributor Author

dxlbnl commented Mar 29, 2017

Okay, added test, but it's failing for some reason (possibly another bug).

@dxlbnl
Copy link
Contributor Author

dxlbnl commented Mar 29, 2017

The failing test says:

  1) generate inline helpers component-binding-deep:
     TypeError: Cannot read property 'deep' of undefined
      at renderMainFragment (test\generator\samples\component-binding-deep\main.html:19:26)
      at new Main (test\generator\samples\component-binding-deep\main.html:104:19)
      at env.then.window (test\generator\index.js:109:24)
      at process._tickCallback (internal/process/next_tick.js:109:7)

Which is caused by:

        var widget_initialData = {};
        if ( 'name' in root.root.deep ) widget_initialData.value = root.deep.name;
                data: widget_initialData

I think root.root.deep is wrong, and it should have been root.deep. But I'm not sure.

@Conduitry
Copy link
Member

I think the root. will always be getting prepended already via Generator.js so I believe this can be fixed by just removing the root. that's prepended in addComponentBindings.js. This does make the unit tests pass, but I defer to Rich on whether that's the real solution.

@Rich-Harris Rich-Harris merged commit 6eb96aa into sveltejs:master Mar 29, 2017
@Rich-Harris
Copy link
Member

so I believe this can be fixed by just removing the root

spot on — this whole bug was just the result of some careless copying and pasting on my part, I think. Sorry! 😊 Will cut a new release momentarily

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.

<Component bind:foo='bar.baz'/> results in broken code
3 participants