Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update CoreBrowserService.ts #5303

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

frost-cy
Copy link

@frost-cy frost-cy commented Jan 28, 2025

Move the initializer into the constructor for instance members that reference identifiers declared in the constructor.

When TypeScript outputs modern language features, the below case throws an TS error.

class C {
  a = this.x; // TS2729: Property 'x' is used before its initialization. 

  constructor(public x:number){}
}

This error is fixed by moving the initializer of such class members into the constructor.

This is a no-op change

Move the initializer into the constructor for instance members that reference identifiers declared in the constructor.

When TypeScript outputs modern language features, the below case throws an TS error.

class C {
  a = this.x; // TS2729: Property 'x' is used before its initialization. 

  constructor(public x:number){}
}
This error is fixed by moving the initializer of such class members into the constructor.

This is a no-op change

cl/718972306
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant