Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Normative: Arbitrary module namespace identifier names#49297

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Closed
Jack-Works wants to merge6 commits intomicrosoft:mainfromJack-Works:ecma262-2154

Conversation

@Jack-Works
Copy link
Contributor

@Jack-WorksJack-Works commentedMay 29, 2022
edited
Loading

Implementingtc39/ecma262#2154

ExE-Boss and pauldraper reacted with thumbs up emojiExE-Boss reacted with hooray emojiExE-Boss reacted with heart emojiExE-Boss and uhyo reacted with rocket emoji
@typescript-bottypescript-bot added the For Milestone BugPRs that fix a bug with a specific milestone labelMay 29, 2022
@typescript-bottypescript-bot added For Uncommitted BugPR for untriaged, rejected, closed or missing bug and removed For Milestone BugPRs that fix a bug with a specific milestone labelsApr 23, 2023
@Jack-Works
Copy link
ContributorAuthor

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) {
Copy link
Contributor

@ExE-BossExE-BossApr 23, 2023
edited
Loading

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Nit: extraneous whitespace:

Suggested change
if(nameArg){
if(nameArg){

@Jack-Works
Copy link
ContributorAuthor

Jack-Works commentedJun 14, 2023
edited
Loading

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.

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}

@DanielRosenwasser
Copy link
Member

I think the comment

Default export symbol (technically not wholly internal, but included here for usability)

is the key here, and the same applies toThis. those symbols are just for comparisons in various places. If anything relied onthis ordefault being special entities within a symbol table, they'd probably already be broken.

Maybe@weswigham or@gabritto can back me up on that statement though.

@Jack-WorksJack-Works deleted the ecma262-2154 branchJune 4, 2024 21:28
@microsoftmicrosoft locked asresolvedand limited conversation to collaboratorsOct 16, 2025
Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.

Reviewers

@DanielRosenwasserDanielRosenwasserDanielRosenwasser left review comments

Copilot code reviewCopilotAwaiting requested review from CopilotCopilot will automatically review once the pull request is marked ready for review

+1 more reviewer

@ExE-BossExE-BossExE-Boss left review comments

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Labels

For Uncommitted BugPR for untriaged, rejected, closed or missing bug

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

4 participants

@Jack-Works@DanielRosenwasser@ExE-Boss@typescript-bot

[8]ページ先頭

©2009-2025 Movatter.jp