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

bug in this when TaggedTemplateExpression.tag is a SequenceExpression #4088

Closed
kzc opened this issue May 23, 2021 · 0 comments · Fixed by #4110
Closed

bug in this when TaggedTemplateExpression.tag is a SequenceExpression #4088

kzc opened this issue May 23, 2021 · 0 comments · Fixed by #4110

Comments

@kzc
Copy link
Contributor

kzc commented May 23, 2021

  • Rollup Version: rollup v2.49.0
  • Operating System (or Browser): n/a
  • Node Version (if applicable): n/a

Repro

$ cat seqtaggedtemplate.js
"use strict";
let o = {
    f() {
        console.log(this === o ? "FAIL" : "PASS");
    }
};
(1, 2, 3, o.f)();
(1, 2, 3, o.f)``;

Expected Behavior

$ cat seqtaggedtemplate.js | node
PASS
PASS

Actual Behavior

$ cat seqtaggedtemplate.js | rollup --silent
let o = {
    f() {
        console.log(this === o ? "FAIL" : "PASS");
    }
};
(0, o.f)();
(o.f)``;
$ cat seqtaggedtemplate.js | rollup --silent | node --use_strict
PASS
FAIL

Whatever logic that Rollup uses to preserve the sequence semantics in CallExpression.callee should also be applied to TaggedTemplateExpression.tag.

@kzc kzc changed the title bug when TaggedTemplateExpression.tag is a SequenceExpression bug in this when TaggedTemplateExpression.tag is a SequenceExpression May 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants