Skip to content

fix: diagnostic message for class name 'Object' when targeting different ECMAScript versions #61358

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

Closed
wants to merge 60 commits into from

Conversation

idango10
Copy link
Contributor

@idango10 idango10 commented Mar 5, 2025

Fixes: #61270

@github-project-automation github-project-automation bot moved this to Not started in PR Backlog Mar 5, 2025
@typescript-bot typescript-bot added the For Backlog Bug PRs that fix a backlog bug label Mar 5, 2025
idango10 and others added 25 commits March 5, 2025 23:19
…ns group (microsoft#61387)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Daniel Rosenwasser <DanielRosenwasser@users.noreply.github.com>
…ns group (microsoft#61509)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…ft#52723)

Co-authored-by: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com>
…osoft#61601)

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
)

Co-authored-by: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com>
Co-authored-by: Jake Bailey <5341706+jakebailey@users.noreply.github.com>
Co-authored-by: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com>
Co-authored-by: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com>
csigs and others added 18 commits June 4, 2025 12:51
Co-authored-by: Ujjwal Sharma <ryzokuken@disroot.org>
Co-authored-by: Nicolò Ribaudo <hell@nicr.dev>
Co-authored-by: Jake Bailey <5341706+jakebailey@users.noreply.github.com>
@@ -7598,7 +7598,7 @@ export const enum ScriptKind {
// June of each year. This includes changes to `LanguageFeatureMinimumTarget`, `ScriptTarget`,
// `ScriptTargetFeatures` transformers/esnext.ts, compiler/commandLineParser.ts,
// compiler/utilitiesPublic.ts, and the contents of each lib/esnext.*.d.ts file.
export const enum ScriptTarget {
export enum ScriptTarget {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should not be changed.

error(
name,
Diagnostics.Class_name_cannot_be_Object_when_targeting_0_with_module_1,
ScriptTarget[languageVersion],
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We shouldn't be using reverse mapping to find the names of language versions, as this depends on how the enum is defined and will break if two things alias each other. We should have some other standard way to print out target kinds like this.

I'd personally suggest just making the message say "ES5 and above".

@github-project-automation github-project-automation bot moved this from Not started to Waiting on author in PR Backlog Jun 11, 2025
@typescript-bot
Copy link
Collaborator

It looks like you've sent a pull request to update some generated declaration files related to the DOM. These files aren't meant to be edited by hand, as they are synchronized with files in the TypeScript-DOM-lib-generator repository. You can read more here. For house-keeping purposes, this pull request will be closed.

@github-project-automation github-project-automation bot moved this from Waiting on author to Done in PR Backlog Jun 11, 2025
@idango10
Copy link
Contributor Author

Sorry for the rebase flop 😅
I'll create a new PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
For Backlog Bug PRs that fix a backlog bug
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Error "Class name cannot be 'Object' when targeting ES5 with module CommonJS." when not targeting es5