Comments (3)
Alternatively, we don't add the reservation and if we bottom-out on a private get or set where no object in the prototype chain defined the private member, we throw a TypeError exception.
from proposal-private-methods.
This does seem to be well-defined spec text which addresses @jridgewell's issue. However, it doesn't meet another design goal of private in classes: That no observable or hookable meta-object operation is done in the course of private field access. You can put a Proxy in the prototype chain and get a hint of what's going on here, or even change the thing being bound to dynamically. That's something the private class element proposals try to avoid.
from proposal-private-methods.
We've thought about a bunch of alternatives for how private methods could work through inheritance. I've summarized this idea and others, about some sort of prototype chain, in this document. Ultimately, it seems like the downsides outweigh the upsides.
from proposal-private-methods.
Related Issues (20)
- Using mask, masked or local when declaring private methods HOT 8
- Typo on spec.html HOT 2
- out of sync: PrivateFieldValues vs PrivateFieldDescriptors HOT 10
- Using "_" instead of "#" HOT 2
- Update progress of Babel Implementation HOT 3
- Update naming, et. al., to align with latest class fields changes HOT 1
- Writing the same method value to a private method should work HOT 5
- Private function and var naming with # looks so odd, can we use __ instead HOT 3
- Inline ins and del in grammar productions not working HOT 1
- Using # as part of the name of the field is not javascripty HOT 5
- Accessible from a super class? HOT 3
- Should accessing a private name of incorrect type be an early error? HOT 22
- How syntax consensus has been formed over private elements? HOT 1
- Scoped class methods, properties HOT 2
- Please use words that make sense; HOT 3
- Extending a Base Class. Private reference not allowed? HOT 8
- spec: update syntax to forbid private method in object literal HOT 1
- Little suggestion for a better syntax HOT 2
- Should 'obj?.#prop' be allowed? HOT 3
- What does #constructor leave for? HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from proposal-private-methods.