mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-11-18 17:21:48 +00:00
For performance reasons, we should always pass sourceFile to getChildren if available.
This commit is contained in:
1 parent
e9e5ebee73
commit
b3b6c3bdbc
1 file changed
+1
-1
@@ -679,7 +679,7 @@ namespace ts {
|
||||
let current: Node = sourceFile;
|
||||
outer: while (true) {
|
||||
// find the child that contains 'position'
|
||||
for (const child of current.getChildren()) {
|
||||
for (const child of current.getChildren(sourceFile)) {
|
||||
const start = allowPositionInLeadingTrivia ? child.getFullStart() : child.getStart(sourceFile, /*includeJsDoc*/ true);
|
||||
if (start > position) {
|
||||
// If this child begins after position, then all subsequent children will as well.
|
||||
|
||||
Reference in new issue
Block a user