The deafult quasi
`hello ${ 42 }`
generates
var $__0 = Object.freeze({ cooked: Object.freeze(["hello "]) });
traceur.runtime.defaultQuasi($__0, 42);
We can simplify this a lot for the default quasi and just generate:
"hello " + (42) + ""
Once we have one string we can skip empty strings. For example
`${1}${2}${3}`
could naïvely be generated as
"" + (1) + "" + (2) + "" + (3) + ""
but once we have on string we can skip future empty string... resulting in
"" + (1) + (2) + (3)
we can also optimize away the parentheses
Original issue reported on code.google.com by arv@chromium.org on 25 Jun 2012 at 10:54
Original issue reported on code.google.com by
arv@chromium.org
on 25 Jun 2012 at 10:54