-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Symbols couldn't convert properly with String() method #6272
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
Comments
This statement is always false - the lefthand side of the equality is not a string primitive, but rather a string object - string objects are only checked by reference equality. Since the right hand side is not a string object (its a string primitive), the two are never equal. This isn't a typescript thing - this is normal JS behavior. |
@weswigham in JS when you call |
@weswigham Typing that command into the Javascript console on Chrome (with the experimental Javascript flag on) returns |
The same is |
Op, sorry, I was mistaken - totally though I saw |
I believe that this either depends on your JS runtime or your polyfill, so this isn't TypeScript-specific. |
@DanielRosenwasser this feature one of the required for full support of Symbols in TypeScript. |
@greybax but if you notice, it is not something that is down emittable to ES5. All the transpilers don't (cannot) support it, because it depends on the runtime engine behaving different in ES6. |
@kitsonk is correct. Babel achieves this here by bundling core.js. We could also bundle core.js to achieve some of the runtime polyfills, but we'd prefer to avoid adding a dependency if possible and let users opt in to that on their own. |
ok |
The next statement should return
true
:The text was updated successfully, but these errors were encountered: