mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-04 21:53:42 -06:00
Merge pull request #2107 from Microsoft/destructuring_classElements
do not include constructor parameters with binding patterns as names whe...
This commit is contained in:
commit
4065ebfd63
@ -423,11 +423,11 @@ module ts.NavigationBar {
|
||||
});
|
||||
|
||||
// Add the constructor parameters in as children of the class (for property parameters).
|
||||
// Note that *all* parameters will be added to the nodes array, but parameters that
|
||||
// Note that *all non-binding pattern named* parameters will be added to the nodes array, but parameters that
|
||||
// are not properties will be filtered out later by createChildItem.
|
||||
var nodes: Node[] = removeDynamicallyNamedProperties(node);
|
||||
if (constructor) {
|
||||
nodes.push.apply(nodes, constructor.parameters);
|
||||
nodes.push.apply(nodes, filter(constructor.parameters, p => !isBindingPattern(p.name)));
|
||||
}
|
||||
|
||||
var childItems = getItemsWorker(sortNodes(nodes), createChildItem);
|
||||
|
||||
@ -0,0 +1,14 @@
|
||||
/// <reference path='fourslash.ts'/>
|
||||
|
||||
////class A {
|
||||
//// x: any
|
||||
//// constructor([a]: any) {
|
||||
//// }
|
||||
////}
|
||||
////class B {
|
||||
//// x: any;
|
||||
//// constructor( {a} = { a: 1 }) {
|
||||
//// }
|
||||
////}
|
||||
|
||||
verify.getScriptLexicalStructureListCount(6); // 2x(class + field + constructor)
|
||||
Loading…
x
Reference in New Issue
Block a user