FIX: Prevent duplicate params for raw template theme handlebars helpers

This commit is contained in:
David Taylor
2019-02-08 12:54:00 +00:00
parent e3324737ee
commit 95b5c5898e
3 changed files with 14 additions and 6 deletions

View File

@ -62,6 +62,12 @@ describe ThemeJavascriptCompiler do
expect(render("{{dummy-helper themeSettings.setting_key}}")).
to eq('dummy(setting(22:setting_key))')
end
it "doesn't duplicate number parameter inside {{each}}" do
expect(compiler.compile("{{#each item as |test test2|}}{{theme-setting 'setting_key'}}{{/each}}")).
to include('{"name":"theme-setting","hash":{},"hashTypes":{},"hashContexts":{},"types":["NumberLiteral","StringLiteral"]')
# Fail would be if theme-setting is defined with types:["NumberLiteral","NumberLiteral","StringLiteral"]
end
end
describe ThemeJavascriptCompiler::EmberTemplatePrecompiler do