Comments (3)
OK, I don't think there's much reason to make it a Symbol. It's nice to have typeof differentiate, as @Jamesernator says. We already agree that private names will not work with []
, and it would be strange to have some Symbols work with []
and others not.
from proposal-decorators.
What's the advantage of having them as Symbols? I think it'd be worse for creators of decorators if they couldn't rely on typeof ... === 'symbol'
reliably allowing []
to work.
e.g. Checking if a name was private inside a decorator would need to be something like:
if (typeof descriptor.key === 'symbol' && descriptor.key.isPrivate) {
return descriptor.key.get(...)
} else {
return ...[descriptor.key]
vs just a plain typeof:
if (typeof descriptor.key === 'privatename') {
return descriptor.key.get(...)
} else {
return ...[descriptor.key]
}
Given that PrivateNames have virtually none of the semantics of Symbols and vice versa I don't see the point of making PrivateName a special case of Symbol.
from proposal-decorators.
I think that it's related zenparsing/es-abstract-refs#11
from proposal-decorators.
Related Issues (20)
- Stage 3 allow decorators to generate PJOs HOT 1
- Timeline / proposal for extensions? HOT 8
- Using accessors makes code less clean and readable HOT 21
- Counterintuative ordering when using `accessor` in combination with `init` methods HOT 37
- Can't dynamically set private field in initializer HOT 17
- Context.private doesn't seem to support group accessor HOT 1
- Support changing the backing field used by auto-accessors HOT 2
- Towards stage 4 HOT 14
- Field and Accessor initializers should run after the field/accessor has been defined HOT 12
- Stage 3 cannot access the class for static method decorator HOT 3
- Idea: syntax for decorator composition. HOT 3
- How to exclude methods from class decorator HOT 2
- Add target class to the context HOT 6
- Order of execution HOT 3
- It isn't clear when `addInitializer` functions are called on class decorator HOT 2
- feature request (separate proposal?): `context.addPostInitializer()` HOT 18
- Readme text and types are outdated against actual spec HOT 2
- Field decorator initializer should support configurable field HOT 8
- Was there a purpose for non-lexical ordering of decorator applications? HOT 2
- Write upgrade guide for previous iterations to Stage 3
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-decorators.