From 3afe0a4d431a8edefeef85c88ac18b9f3622362c Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Fri, 1 Mar 2019 16:34:09 -0800 Subject: [PATCH] Fix out-of-bounds issue in getParameterNameAtPosition --- src/compiler/checker.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 9b59cb3574d..179e5fb04d0 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -21641,7 +21641,7 @@ namespace ts { if (isTupleType(restType)) { const associatedNames = ((restType).target).associatedNames; const index = pos - paramCount; - return associatedNames ? associatedNames[index] : restParameter.escapedName + "_" + index as __String; + return associatedNames && associatedNames[index] || restParameter.escapedName + "_" + index as __String; } return restParameter.escapedName; }