Skip to content

Unexpected named exports, related to spread operator #162

@duncanbeevers

Description

@duncanbeevers

It appears function parameters are jumping into the list of module exports.
swc version 0.1.7

Input

export const good = {
  a(bad1) {
    (...bad2) => { };
  }
};

Output

var _ref = {
    a: function(bad1) {
        (function() {
            for(var _len = arguments.length, bad2 = new Array(_len), _key = 0; _key < _len; _key++){
                bad2['_key'] = arguments['_key'];
            }
        });
    }
}, good = _ref;
export { good, bad1, bad2 }

Note the unexpected bad1, and bad2 exports.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions