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

Appearance settings

Commit e6256d4

Browse filesBrowse files
author
Andy
authored
Inline getDestructuringParameterName (microsoft#16973)
1 parent 17578e8 commit e6256d4
Copy full SHA for e6256d4

1 file changed

+2-6Lines changed: 2 additions & 6 deletions

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎src/compiler/binder.ts‎

Copy file name to clipboardExpand all lines: src/compiler/binder.ts
+2-6Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1172,7 +1172,7 @@ namespace ts {
11721172
}
11731173

11741174
function pushActiveLabel(name: __String, breakTarget: FlowLabel, continueTarget: FlowLabel): ActiveLabel {
1175-
const activeLabel = {
1175+
const activeLabel: ActiveLabel = {
11761176
name,
11771177
breakTarget,
11781178
continueTarget,
@@ -1897,10 +1897,6 @@ namespace ts {
18971897
file.bindDiagnostics.push(createFileDiagnostic(file, span.start, span.length, message, arg0, arg1, arg2));
18981898
}
18991899

1900-
function getDestructuringParameterName(node: Declaration): __String {
1901-
return "__" + indexOf((<SignatureDeclaration>node.parent).parameters, node) as __String;
1902-
}
1903-
19041900
function bind(node: Node): void {
19051901
if (!node) {
19061902
return;
@@ -2514,7 +2510,7 @@ namespace ts {
25142510
}
25152511

25162512
if (isBindingPattern(node.name)) {
2517-
bindAnonymousDeclaration(node, SymbolFlags.FunctionScopedVariable, getDestructuringParameterName(node));
2513+
bindAnonymousDeclaration(node, SymbolFlags.FunctionScopedVariable, "__" + indexOf(node.parent.parameters, node) as __String);
25182514
}
25192515
else {
25202516
declareSymbolAndAddToSymbolTable(node, SymbolFlags.FunctionScopedVariable, SymbolFlags.ParameterExcludes);

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.