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 }}
This repository was archived by the owner on Jan 25, 2022. It is now read-only.
roughly just replace # with .private., which make much more sense.
since you dont like it, just try Symbol.private
example:
classfoo{[Symbol.private]={// need magic here to make it truly privatex: 0}functionbar(){this[Symbol.private].x+=1;// approved}
...
}...(newfoo())[Symbol.private].x// denied
This will introduce a new well known Symbol Symbol.private, and the only thing the engine need to do is, make object[Symbol.private] private.
roughly just replace
#with.private., which make much more sense.since you dont like it, just try
Symbol.privateexample:
This will introduce a new well known Symbol
Symbol.private, and the only thing the engine need to do is, makeobject[Symbol.private]private.