Template strings are cached incorrectly
TypeScript Version: 3.2.0-dev.20180929
Search Terms:
- template literal
Code
var invokes = []; function test(template, _) { invokes.push(template); } function update(value) { test`some ${value}!`; } update(1); update(2); document.body.textContent = '' + (invokes[0] === invokes[1]);
Expected behavior:
After compiling and running the code in a browser console, the body's content should be "true".
The code works as expected when compiled with Babel, or run verbatim in a browser console.
Actual behavior:
The body's content becomes "false". This breaks libraries such as hyperHTML (note: now it contains a workaround that works for me at least WebReflection/hyperHTML@6d3d879)
Related Issues: