Skip to content

Name property of anonymous class extending another classes is set inconsistently #36038

@StenCalDabran

Description

@StenCalDabran

Setup

  • Version: one behaviour for latest 12 (12.19.0) and 15 versions (15.0.1), the other behaviour for the latest 14 (14.15.0) and older 12 versions (e.g. 12.13.0)
  • Platform: Platform-independent (same behaviour on Windows, Mac and within Docker container)
  • Subsystem: ?

What steps will reproduce the bug?

Run the following Javascript code

class SomeClass {}
console.log('Anonymous name property is:', class extends SomeClass {}.name);

How often does it reproduce? Is there a required condition?

No additional conditions beside node version.

What is the expected behavior?

I am not sure what the expected behaviour is, but it should be consistent at least for all latest minor versions of still supported major versions

What do you see instead?

For version 12.19.0 and 15.0.1 the name property of the anonymous class is an empty string.
For version 12.13.0 and 14.15.0 the name property of the anonymous class is the name of the extended class, i.e. 'SomeClass' in the example.

Metadata

Metadata

Assignees

No one assigned

    Labels

    v8 engineIssues and PRs related to the V8 dependency.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions