Can't use aliases of the global `Symbol` value to refer to its properties in the same manner or create unique symbols
See original GitHub issueAlthough Nodejs also uses this technique, we can’t do the same thing.
https://github.com/nodejs/node/search?q=primordials+symbol&unscoped_q=primordials+symbol
TypeScript Version: 3.7.x-dev.20200125
Search Terms:
Code
export { }
const Symbol = globalThis.Symbol;
const sym = Symbol();
[][Symbol.iterator];
Expected behavior:
const sym = Symbol(); // typeof sym
[][Symbol.iterator]; // Refer iterator method
Actual behavior:
const sym = Symbol(); // symbol
[][Symbol.iterator]; // error
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:10 (10 by maintainers)
Top Results From Across the Web
Symbol - JavaScript - MDN Web Docs
Chrome Edge
Symbol Full support. Chrome38. Toggle history Full support. Edge12. footnote...
@@toPrimitive Full support. Chrome47. Toggle history Full support. Edge15. Toggle...
Symbol() constructor Full support....
Read more >Symbol Processing (Linker and Libraries Guide)
All global symbols are accumulated internally within the link-editor. Each global symbol supplied by a relocatable object is searched for within this internal ......
Read more >Details of the policy definition structure - Azure - Microsoft Learn
When a resource property field is an array, a special array alias can be used to select values from all array members and...
Read more >Introduction to JavaScript “Symbols” and their use in ... - Medium
Two symbols can't have the same value if created from the Symbol() call since every Symbol() call, with or without a description, ...
Read more >Documentation - Everyday Types - TypeScript
As you might expect, these are the same names you'd see if you used the JavaScript typeof operator on a value of those...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
And can’t make unique symbols using an alias of the
Symbol
function. Don’t miss it.@falsandtru if you can come cook dinner and tend to my kid I can work evenings