Skip to content

Override keyword on properties is being emitted in ESNext outputΒ #44455

Closed
@arciisine

Description

@arciisine

Bug Report

πŸ”Ž Search Terms

override esnext emit output

πŸ•— Version & Regression Information

  • This is new behavior introduced in the 4.3 release

⏯ Playground Link

Playground link with relevant code

πŸ’» Code

export class ServiceInherit {
  age = 30;
}

export class ServiceInherit2 extends ServiceInherit {
  override age = 31;
}

πŸ™ Actual behavior

Output is currently being produced with the override keyword, when targetting ESNext as the language target.

Common JS Output

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.ServiceInherit2 = exports.ServiceInherit = void 0;
class ServiceInherit {
    age = 30;
}
exports.ServiceInherit = ServiceInherit;
class ServiceInherit2 extends ServiceInherit {
    override age = 31;
}
exports.ServiceInherit2 = ServiceInherit2;

ESNext Module Ouptut

export class ServiceInherit {
    age = 30;
}
export class ServiceInherit2 extends ServiceInherit {
    override age = 31;
}

πŸ™‚ Expected behavior

The output should not include non-standard keywords like override.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions