8000 Remove unused pure curried functions where possible · Issue #1263 · rollup/rollup · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Remove unused pure curried functions where possible #1263
Closed
@hdgarrood

Description

@hdgarrood

With Rollup v0.41.4, using the following input:

function foo(a) {
  return function(b) {
    return a+b;
  }
}

function bar(a, b) {
  return a+b;
}

foo(1)(2);
bar(1,2);

Note that foo and bar are the same function except that foo is curried.

When bundling this as ES2015, I hoped to see an empty module, but got this:

function foo(a) {
  return function(b) {
    return a+b;
  }
}

foo(1)(2);

Here's a repro on rollupjs.org.

If this is something you'd like Rollup to be able to do, I'd be interested in working on this.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0