Skip to content

Missing side-effects #39

Description

@Rich-Harris

Given this situation...

// main.js
import Foo from './Foo';
var foo = new Foo();
var baz = new Foo.Baz();

// Foo.js
import { Bar } from './Bar';
import { Baz } from './Baz';

Bar.Baz = Baz; // this statement is ignored

export default Bar;

// Bar.js
export function Bar () {
  alert( 'bar' );
}

// Baz.js
export function Baz () {
  alert('baz');
}

...we'd expect Foo to have a Baz property, but Rollup goes straight to the original Foo definition, ignoring the Bar.Baz = Baz line:

function Bar () {
  alert( 'bar' );
}

var Foo = Bar;

var foo = new Foo();
var baz = new Foo.Baz();

We need to catch any statements that mutate imported bindings, wherever they are.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions