Clarify specification for “context.name” for private vs public elements.#570
Open
theengineear wants to merge 1 commit into
Open
Clarify specification for “context.name” for private vs public elements.#570theengineear wants to merge 1 commit into
theengineear wants to merge 1 commit into
Conversation
The babel transpiler I’m using appears to always return a _string_ here (even for private elements). When we looked back at this proposal, it felt like there was potentially room for interpretation! This attempts to make two things more explicit: 1. If the element is private, `context.name` returns a `Symbol`, not a `String`. 2. And, if the element is private `context.name.description` is a `#`-prefixed string mirroring the name provided by the developer.
Author
|
Feel free to close this, I found myself trying to write an issue for this… but it felt much easier to ask this question over code. I wanted to clarify the intent here first before potentially opening an issue in the babel transpiler (if this is even something that can be accomplished via transpilation). Thanks for taking a look and apologies for the noise I’ve been making! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The babel transpiler I’m using appears to always return a string here (even for private elements). When I looked back at this proposal, it felt like there was potentially room for interpretation!
This attempts to make two things more explicit:
context.namereturns aSymbol, not aString.context.name.descriptionis a#-prefixed string mirroring the name provided by the developer.