You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Error accessing private property in destructuring with computed property name #26356
classFoo{privatebar=1;}letfoo=newFoo();foo.bar;// error as expectedfoo['bar'];// no error as expectedlet{bar}=foo;// error as expectedlet{'bar': bar2}=foo;// error (expected?)let{['bar']: bar3}=foo;// error (expected?)
Expected behavior:
#26328 states that accessing non-public properties via element access with string literal or late-bound name is intentionally allowed.
To be consistent that should also apply to destructuring with computed property name or quoted name.
Activity