-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Closed
Labels
Description
Code example
const tag = (strings, ...args) => {
return strings.raw
};
tag`begin${'first'}middle${'second'}end`;
Expected output is ["begin", "middle", "end"] (with args[0] = "first" and args[1] = "middle")
But current output is ["", ""] (with args[0] = "beginfirstmiddlesecondend")
This is because code is obfuscating into this (with simplest settings):
const tag = (a, ...b) => {
return a['raw'];
};
tag`${ 'begin' + 'first' + 'middle' + 'second' + 'end' }`;
I'm using tag functions and need to distinguish parts of template strings, but with such behavior it doesn't work
Sorry for bad English
Reactions are currently unavailable