Skip to content

Commit

Permalink
fix: change filtering logic to not include nested property elements (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
zobo authored Feb 24, 2022
1 parent 2d42cf7 commit c6588ba
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 9 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/).

## [1.24.3]

- Fox for broken property traversal #755

## [1.24.2]

- Additional fix for extended root property in eval #751
Expand Down
18 changes: 9 additions & 9 deletions src/xdebugConnection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -571,9 +571,9 @@ export class Property extends BaseProperty {
}
this.context = context
if (this.hasChildren) {
this.children = Array.from((<Element>propertyNode).getElementsByTagName('property')).map(
(propertyNode: Element) => new Property(propertyNode, context)
)
this.children = Array.from(propertyNode.childNodes)
.filter(node => node.nodeName === 'property')
.map((propertyNode: Element) => new Property(propertyNode, context))
}
}

Expand Down Expand Up @@ -644,9 +644,9 @@ export class PropertyGetResponse extends Response {
*/
constructor(document: XMLDocument, context: Context) {
super(document, context.stackFrame.connection)
this.children = Array.from(
(<Element>document.documentElement.firstChild!).getElementsByTagName('property')
).map((propertyNode: Element) => new Property(propertyNode, context))
this.children = Array.from(document.documentElement.firstChild!.childNodes)
.filter(node => node.nodeName === 'property')
.map((propertyNode: Element) => new Property(propertyNode, context))
}
}

Expand All @@ -670,9 +670,9 @@ export class EvalResultProperty extends BaseProperty {
constructor(propertyNode: Element) {
super(propertyNode)
if (this.hasChildren) {
this.children = Array.from(propertyNode.getElementsByTagName('property')).map(
(propertyNode: Element) => new EvalResultProperty(propertyNode)
)
this.children = Array.from(propertyNode.childNodes)
.filter(node => node.nodeName === 'property')
.map((propertyNode: Element) => new EvalResultProperty(propertyNode))
}
}
}
Expand Down

0 comments on commit c6588ba

Please sign in to comment.