Fixing issue: mu.render advertises a parse-object as the first param, but expects an array #39

Merged
merged 1 commit into from Aug 20, 2012

Projects

None yet

2 participants

@nemtsov
Contributor
nemtsov commented Jun 23, 2012

Issue: mu.render advertises the parse object as the first param, but expects an array (as it gets one from the cache). Example:

var mu = require('mu')
  , parsed = mu.compileText('{{greeting}}, world!')
  , stream = mu.render(parsed, {greeting: 'Hello'});
stream.on('data', function (data) {
  console.log(data);
});

Throws the following:

return beginRender(parsed[0].tokens, view, mu.cache);
                            ^
TypeError: Cannot read property 'tokens' of undefined
    at Object.render (./lib/mu.js:108:33)
@raycmorgan raycmorgan merged commit b74956b into raycmorgan:master Aug 20, 2012
@raycmorgan
Owner

Thanks for the fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment