Uh oh!
There was an error while loading. Please reload this page.
Normative: Arbitrary module namespace identifier names - #49297
Normative: Arbitrary module namespace identifier names#49297Jack Works (Jack-Works) wants to merge 6 commits into
Conversation
27c4aae to
026fba8CompareJack Works (Jack-Works)
commented
Apr 23, 2023
Made a full rewrite of this PR. Just get the compiler part to work. Will handle language service days later. |
| let suggestedLib: string | undefined; | ||
| // Report missing lib first | ||
| if (nameArg) { | ||
| if (nameArg) { |
There was a problem hiding this comment.
Nit: extraneous whitespace:
| if(nameArg){ | |
| if(nameArg){ |
ab0073c to
89b405bCompare89b405b to
2435a73CompareUh oh!
There was an error while loading. Please reload this page.
Hi, Daniel Rosenwasser (@DanielRosenwasser) I have a question. With this PR, it's possible to define members with names that cannot be an identifier on a Symbol. exportconstenumInternalSymbolName{Call="__call",// Call signaturesConstructor="__constructor",// Constructor implementationsNew="__new",// Constructor signaturesIndex="__index",// Index signaturesExportStar="__export",// Module export * declarationsGlobal="__global",// Global self-referenceMissing="__missing",// Indicates missing symbolType="__type",// Anonymous type literal symbolObject="__object",// Anonymous object literal declarationJSXAttributes="__jsxAttributes",// Anonymous JSX attributes object literal declarationClass="__class",// Unnamed class expressionFunction="__function",// Unnamed function expressionComputed="__computed",// Computed property name declaration with dynamic nameResolving="__resolving__",// Indicator symbol used to mark partially resolved type aliasesExportEquals="export=",// Export assignment symbolDefault="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{itemas"this"}// orexport{itemas"export=",itemas__new} |
I think the comment
is the key here, and the same applies to Maybe Wesley Wigham (@weswigham) or Gabriela Araujo Britto (@gabritto) can back me up on that statement though. |
Implementing tc39/ecma262#2154