{{ message }}
Normative: Arbitrary module namespace identifier names#49297
Closed
Jack-Works wants to merge 6 commits into
Closed
Normative: Arbitrary module namespace identifier names#49297Jack-Works wants to merge 6 commits into
Jack-Works wants to merge 6 commits into
Conversation
27c4aae to
026fba8
Compare
Contributor
Author
ExE-Boss
reviewed
Apr 23, 2023
| let suggestedLib: string | undefined; | ||
| // Report missing lib first | ||
| if (nameArg) { | ||
| if (nameArg) { |
Contributor
There was a problem hiding this comment.
Nit: extraneous whitespace:
Suggested change
| if (nameArg) { | |
| if (nameArg) { |
5 tasks
ab0073c to
89b405b
Compare
Contributor
Author
|
Hi, @DanielRosenwasser I have a question. With this PR, it's possible to define members with names that cannot be an identifier on a Symbol. export const enum InternalSymbolName {
Call = "__call", // Call signatures
Constructor = "__constructor", // Constructor implementations
New = "__new", // Constructor signatures
Index = "__index", // Index signatures
ExportStar = "__export", // Module export * declarations
Global = "__global", // Global self-reference
Missing = "__missing", // Indicates missing symbol
Type = "__type", // Anonymous type literal symbol
Object = "__object", // Anonymous object literal declaration
JSXAttributes = "__jsxAttributes", // Anonymous JSX attributes object literal declaration
Class = "__class", // Unnamed class expression
Function = "__function", // Unnamed function expression
Computed = "__computed", // Computed property name declaration with dynamic name
Resolving = "__resolving__", // Indicator symbol used to mark partially resolved type aliases
ExportEquals = "export=", // Export assignment symbol
Default = "default", // Default export symbol (technically not wholly internal, but included here for usability)
This = "this",
}I wonder if this PR gonna make programmers able to write code that breaks TS by declaring a symbol member that has the same name as an internal symbol, like export { item as "this" }
// or
export { item as "export=", item as __new } |
Member
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.

Implementing tc39/ecma262#2154