bem / bem-xjst

bem-xjst (eXtensible JavaScript Templates): declarative template engine for the browser and server
https://bem.github.io/bem-xjst
Other
116 stars 48 forks source link

compile method of template instance should return itself #408

Closed tadatuta closed 7 years ago

tadatuta commented 7 years ago
require('bem-xjst').bemhtml.compile('')
/*
{ apply: [Function: apply],
  compile: [Function: compile],
  BEMContext: { [Function: ContextChild] super_: [Function: Context] } }
*/
require('bem-xjst').bemhtml.compile('').compile('') // undefined

Expected Behavior

compile() method of template instance should return itself

Actual Behavior

returns undefined

tadatuta commented 7 years ago

cc @zxqfox

qfox commented 7 years ago

Yeah, it looks like inconcistency between compiles. Also, would be nice to have a way to not mutate instance (I thought compile does not). ;-(