Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Template string arguments are merging into one #716

Closed
kot-shrodingera opened this issue Aug 18, 2020 · 3 comments
Closed

Template string arguments are merging into one #716

kot-shrodingera opened this issue Aug 18, 2020 · 3 comments

Comments

@kot-shrodingera
Copy link

kot-shrodingera commented Aug 18, 2020

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

@sanex3339 sanex3339 added the bug label Aug 18, 2020
@sanex3339
Copy link
Member

Ohh. Looks like i have to revert #696

@sanex3339
Copy link
Member

I'll release a new release with disabled tagged template literals obfuscation in a few hours.

@sanex3339
Copy link
Member

Released 1.11.0 with disabled tagged template literals obfuscation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants