Skip to content

Commit

Permalink
allow Builder.scriptlet() to accept a string
Browse files Browse the repository at this point in the history
  • Loading branch information
patrick-steele-idem committed Nov 7, 2017
1 parent 25c7b0b commit d3e0fff
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/compiler/Builder.js
Original file line number Diff line number Diff line change
Expand Up @@ -513,8 +513,13 @@ class Builder {
}

scriptlet(scriptlet) {
if (typeof scriptlet === 'string') {
scriptlet = {
code: scriptlet
};
}
return new Scriptlet({
code: scriptlet.value,
code: scriptlet.value || scriptlet.code,
tag: scriptlet.tag,
block: scriptlet.block
});
Expand Down

0 comments on commit d3e0fff

Please sign in to comment.