Skip to content

Editorial: Fix type mismatch for class without constructor #3664

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

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

Conversation

mobius29
Copy link

@mobius29 mobius29 commented Aug 4, 2025

When a class has no explicit constructor, ClassDefinitionEvaluation step 14.b creates the default constructor via CreateBuiltinFunction.
Later, step 14.a.vi calls InitializeInstanceElements(result, F), which expects its second parameter constructor to be an ECMAScript Function Object. However, actual F's type is a Built-in Function Object and this causes type mismatch.

For example:

class A {}
var x = new A();

This PR fixes the inconsistency in two parts

Fixes #3204.

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.

Synthesized constructor in ClassDefinitionEvaluation is missing [[PrivateMethods]] and [[Fields]]
1 participant