mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-06 11:54:44 -06:00
Cherry-pick PR #38351 into release-3.9
Component commits: 39e68564ff Fix regression in name resolution in parameter
This commit is contained in:
parent
90570dfe09
commit
e6709a4cd4
@ -1887,7 +1887,9 @@ namespace ts {
|
||||
lastLocation === (location as BindingElement).name && isBindingPattern(lastLocation))) {
|
||||
const root = getRootDeclaration(location);
|
||||
if (root.kind === SyntaxKind.Parameter) {
|
||||
associatedDeclarationForContainingInitializerOrBindingName = location as BindingElement;
|
||||
if (!associatedDeclarationForContainingInitializerOrBindingName) {
|
||||
associatedDeclarationForContainingInitializerOrBindingName = location as BindingElement;
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
@ -0,0 +1,13 @@
|
||||
// @target: es5, es2015, esnext
|
||||
// @noEmit: true
|
||||
// @noTypesAndSymbols: true
|
||||
|
||||
// https://github.com/microsoft/TypeScript/issues/38243
|
||||
|
||||
function test0({ a = 0, b = a } = {}) {
|
||||
return { a, b };
|
||||
}
|
||||
|
||||
function test1({ c: { a = 0, b = a } = {} } = {}) {
|
||||
return { a, b };
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user