ecmascript 6 - Why don't ES6 tagged template strings provide the original string template? -


when creating tag functions template strings in es6, function expected take literals parameter , values parameter.

tagfunc `hello ${somevar}`;  function tagfunc(literals, ...values){    // } 

however, not provide access original, unevaluated, deconstructed template. example:

tagfunc `hello ${somevar}`;  function tagfunc(literals, ...values, template){    // template 'hello ${somevar}' } 

or perhaps literals.originaltemplate property complement literals.raw.

is there specific reason this? best can think of there may security implication if variable names passed through tag function?


Comments