Skip to content

Commit 6c9ba46

Browse files
committed
Fix compile errors
1 parent 0778627 commit 6c9ba46

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/compiler/checker.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11546,7 +11546,7 @@ namespace ts {
1154611546
if (isBindingPattern(declaration.parent)) {
1154711547
const parentDeclaration = declaration.parent.parent;
1154811548
const name = declaration.propertyName || declaration.name;
11549-
if (isVariableLike(parentDeclaration) &&
11549+
if (parentDeclaration.kind !== SyntaxKind.BindingElement &&
1155011550
parentDeclaration.type &&
1155111551
!isBindingPattern(name)) {
1155211552
const text = getTextOfPropertyName(name);

src/services/breakpoints.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -370,8 +370,8 @@ namespace ts.BreakpointResolver {
370370
}
371371

372372
function textSpanFromVariableDeclaration(variableDeclaration: VariableDeclaration): TextSpan {
373-
const declarations = variableDeclaration.parent.declarations;
374-
if (declarations && declarations[0] === variableDeclaration) {
373+
if (variableDeclaration.parent.kind === SyntaxKind.VariableDeclarationList &&
374+
variableDeclaration.parent.declarations[0] === variableDeclaration) {
375375
// First declaration - include let keyword
376376
return textSpan(findPrecedingToken(variableDeclaration.pos, sourceFile, variableDeclaration.parent), variableDeclaration);
377377
}
@@ -400,8 +400,8 @@ namespace ts.BreakpointResolver {
400400
return textSpanFromVariableDeclaration(variableDeclaration);
401401
}
402402

403-
const declarations = variableDeclaration.parent.declarations;
404-
if (declarations && declarations[0] !== variableDeclaration) {
403+
if (variableDeclaration.parent.kind === SyntaxKind.VariableDeclarationList &&
404+
variableDeclaration.parent.declarations[0] !== variableDeclaration) {
405405
// If we cannot set breakpoint on this declaration, set it on previous one
406406
// Because the variable declaration may be binding pattern and
407407
// we would like to set breakpoint in last binding element if that's the case,

0 commit comments

Comments
 (0)