Skip to content

TS 4.4.0-beta: #44624 change breaks existing code in CommonJS emitΒ #45189

Closed
@DavidANeil

Description

@DavidANeil

Bug Report

πŸ”Ž Search Terms

TS 4.4 beta commonjs

πŸ•— Version & Regression Information

  • This changed between versions 4.3.5 and 4.4.0-beta

⏯ Playground Link

Playground link with relevant code

πŸ’» Code

import {render} from 'less';

render('input', () => {});

πŸ™ Actual behavior

render is called with a this of Window
Emit is

(0, less_1.render)('input', () => { });

πŸ™‚ Expected behavior

render is called with a this of require('less')
Emit should be

less_1.render('input', () => { });

It looks like this was caused by #44624.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Working as IntendedThe behavior described is the intended behavior; this is not a bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions