Skip to content
New issue

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

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

Already on GitHub? # to your account

Implement static class initializer blocks #144

Merged
merged 1 commit into from
Nov 26, 2023

Conversation

bnoordhuis
Copy link
Contributor

Spec compliance bug: "await" is illegal inside initializer blocks except when used as an identifier in a function expression, like so:

class C {
    static {
        var f = function await() {}
    }
}

It is somewhat complicated to make the parser understand the distinction and such code is probably rare or non-existent so I decided to leave well enough alone for now.

Spec compliance bug: "await" is illegal inside initializer blocks
_except_ when used as an identifier in a function expression, like so:

    class C {
        static {
            var f = function await() {}
        }
    }

It is somewhat complicated to make the parser understand the distinction
and such code is probably rare or non-existent so I decided to leave
well enough alone for now.
Copy link
Contributor

@saghul saghul left a comment

Choose a reason for hiding this comment

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

Nice!

@bnoordhuis bnoordhuis merged commit b5148b2 into quickjs-ng:master Nov 26, 2023
@bnoordhuis bnoordhuis deleted the static-class-init-blocks branch November 26, 2023 20:11
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants