pugjs / pug-code-gen

https://github.com/pugjs/pug/tree/master/packages/pug-code-gen
7 stars 9 forks source link

Do not use jade_merge if it is not needed #7

Closed TimothyGu closed 9 years ago

TimothyGu commented 9 years ago

Input:

mixin foo
  // foo

body
  +foo&attributes({class: "hello"})

Before:

buf.push("<body>");
jade_mixins["foo"].call({
  attributes: jade_merge([{
    class: "hello"
  }])
});
buf.push("</body>");

After:

buf.push("<body>");
jade_mixins["foo"].call({
  attributes: {
    class: "hello"
  }
});
buf.push("</body>");
alubbe commented 9 years ago

LGTM. Were there no tests in jade before that we could port to this repo?

TimothyGu commented 9 years ago

Were there no tests in jade before that we could port to this repo?

I guess we can port them. See #5.