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

Incomplete data is not supported #12

Open
bjoern-tantau opened this issue Aug 23, 2017 · 0 comments
Open

Incomplete data is not supported #12

bjoern-tantau opened this issue Aug 23, 2017 · 0 comments

Comments

@bjoern-tantau
Copy link

When the tss is trying to read a non-existent property an uncaught TypeError is thrown.

var xml = '<h1>Foo</h1>';
var tss = 'h1 { repeat: data(headlines); content: iteration(); }';
var template = new Tranjsform.Builder(xml, tss);
template.output();

> tranjsform.js:784 Uncaught TypeError: Cannot read property 'headlines' of undefined
>     at Tranjsform.DataFunction.observe (tranjsform.js:784)
>     at Tranjsform.DataFunction.data (tranjsform.js:757)
>     at Tranjsform.Hook.parseValue (tranjsform.js:449)
>     at Tranjsform.Hook.run (tranjsform.js:418)
>     at Tranjsform.Template.processHooks (tranjsform.js:197)
>     at Tranjsform.Template.output (tranjsform.js:205)
>     at Tranjsform.Builder.output (tranjsform.js:38)
>     at <anonymous>:1:10

template.output({});

> tranjsform.js:737 Uncaught TypeError: Cannot read property '0' of undefined
>     at Tranjsform.DataFunction.bind (tranjsform.js:737)
>     at Tranjsform.Property.Repeat.run (tranjsform.js:692)
>     at Tranjsform.Hook.callProperty (tranjsform.js:425)
>     at Tranjsform.Hook.run (tranjsform.js:418)
>     at Tranjsform.Template.processHooks (tranjsform.js:197)
>     at Tranjsform.Template.output (tranjsform.js:205)
>     at Tranjsform.Builder.output (tranjsform.js:38)
>     at <anonymous>:1:10

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

No branches or pull requests

1 participant