Skip to content

top level this and undefined #111

@dazinator

Description

@dazinator

Hello!
For background detail see: rollup/rollup#2523

Given an AMD module with a top level this for example: var self = this
when this is converted to an ES6 module, it should be transpiled var self = window because as per: http://exploringjs.com/es6/ch_modules.html#_browsers-scripts-versus-modules a top level this equates to window but in the ES6 world a top level this = undefined. At the moment, after the conversion to ES6 the top level this is currently having its value changed from window to undefined breaking scripts..

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions