Skip to content

compiler: add support for shorthand method declarations#387

Open
jow- wants to merge 1 commit intomasterfrom
syntax-method-support
Open

compiler: add support for shorthand method declarations#387
jow- wants to merge 1 commit intomasterfrom
syntax-method-support

Conversation

@jow-
Copy link
Copy Markdown
Owner

@jow- jow- commented Mar 23, 2026

Add support for ES6-style shorthand method syntax in object literals. This allows declaring methods without the function keyword:

obj = {
    foo() { return 42; },
    add(a, b) { return a + b; },
    sum(...args) { ... }
};

Add support for ES6-style shorthand method syntax in object literals.
This allows declaring methods without the `function` keyword:

    obj = {
        foo() { return 42; },
        add(a, b) { return a + b; },
        sum(...args) { ... }
    };

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
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.

1 participant