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

Can not run private fields in the decorator #3866

Open
mantou132 opened this issue Aug 3, 2024 · 0 comments
Open

Can not run private fields in the decorator #3866

mantou132 opened this issue Aug 3, 2024 · 0 comments
Labels

Comments

@mantou132
Copy link

mantou132 commented Aug 3, 2024

Originally published in tc39/proposal-decorators#536

function effect(getDep) {
    return function (_, context) {
        context.addInitializer(function () {
            console.log(context.access.get(this)())
        });
    }
}

class A {
    @effect(() => [1,2])
    #effect() {
        console.log(123)
    }
}

new A();

typescript

no error

swc

no error

babel

no error

esbuild

Uncaught TypeError: Cannot access private method

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants