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

Regression in 1.14.0 with imports and unused parameters #2970

Closed
mikeharder opened this issue Jun 28, 2019 · 1 comment · Fixed by #2972
Closed

Regression in 1.14.0 with imports and unused parameters #2970

mikeharder opened this issue Jun 28, 2019 · 1 comment · Fixed by #2972

Comments

@mikeharder
Copy link

mikeharder commented Jun 28, 2019

  • Rollup Version: Regression introduced in 1.14.0, still repros in 1.16.2
  • Operating System (or Browser): Windows 10
  • Node Version: 10.16.0

Overview

If an imported function and unused parameter have the same name, rollup@1.13.1 renames the parameter which generates a valid bundle, while rollup@1.14.0 (and rollup@1.16.2) does not rename the parameter which causes a runtime error. I believe this is a regression introduced by #2892.

How Do We Reproduce?

// log.js
export const context = console.log;


// main.js
import * as log from "./log";

function test(context) {
  log.context("hello");
}

test();

Expected Behavior

REPL

> npm install --global rollup@1.13.1
> rollup main.js --format cjs
'use strict';

const context = console.log;

function test(context$1) {
  context("hello");
}

test();

Actual Behavior

REPL

> npm install --global rollup@1.14.0
> rollup main.js --format cjs
'use strict';

const context = console.log;

function test(context) {
  context("hello");
}

test();
@lukastaegert
Copy link
Member

Thanks for spotting this, fix at #2972

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