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

Fix 'super' usage in arrow functions. #30

Merged
merged 2 commits into from
May 27, 2024

Conversation

ypapouski
Copy link
Contributor

The PR fixes all issues described in this ticket https://github.com/surfly/it/issues/4581

src/parser.ts Show resolved Hide resolved
@@ -3916,7 +3916,9 @@ export function parseSuperExpression(
case Token.LeftParen: {
// The super property has to be within a class constructor
if ((context & Context.SuperCall) === 0) report(parser, Errors.SuperNoConstructor);
if (context & Context.InClass) report(parser, Errors.InvalidSuperProperty);
if (context & Context.InClass && !(context & Context.InMethod)) {
Copy link
Contributor

Choose a reason for hiding this comment

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

is there a reason why the optional chaining operator is not used here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's because here the bitwise AND & is used or am I missing something?

@ypapouski ypapouski merged commit f262247 into master May 27, 2024
0 of 3 checks passed
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.

3 participants