-
Notifications
You must be signed in to change notification settings - Fork 1
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
Implement can-symbol #1
Comments
Symbol has two APIs: |
@matthewp These are really only for "well known" symbols. They are there primarily for tldr; We only need Symbol.for. |
We need private Symbols in can-zone. |
Why? |
They are semi-private properties. They are unenumerable and can only be touched by outside code if they use Object.getOwnPropertySymbols and even then you can't get the string key used to make that symbol (so effectively you can't tell what a Symbol represents). |
One place where we use them is here: https://github.com/canjs/can-zone/blob/master/lib/zones/xhr.js#L21 to detect of an XHR request should come from the XHR_CACHE that is returned by server rendering. |
This is going to change to a symbol polyfill that also includes the above registered symbols. |
Related issues:
Symbols (and corresponding expected value)
All CanJS symbols will be prefixed with
can.
Type detection:
Boolean
- Item has values at keysBoolean
- Item has values at enumerated keysBoolean
- Item has a single valueBoolean
- Item can be called with argumentsBoolean
Shape detection:
Object.getPropertyDescriptor
would normally provide.Get / Set:
Call:
Observe:
cb() -> valueIndex
cb()
cb() -> valueIndex
cb() -> valueIndex
Methods
.for(key)
.keyFor( description )
Questions
The text was updated successfully, but these errors were encountered: