Skip to content

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

@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