JS: Fix join ordering

This commit is contained in:
Asger Feldthaus
2020-02-06 10:29:05 +00:00
parent b5f3d776bf
commit 38ef07ce73

View File

@@ -48,6 +48,13 @@ abstract class EnumeratedPropName extends DataFlow::Node {
*/
abstract DataFlow::Node getSourceObject();
/**
* Gets a source node that refers to the object whose properties are being enumerated.
*/
DataFlow::SourceNode getASourceObjectRef() {
result = AccessPath::getAnAliasedSourceNode(getSourceObject())
}
/**
* Gets a property read that accesses the corresponding property value in the source object.
*
@@ -56,7 +63,7 @@ abstract class EnumeratedPropName extends DataFlow::Node {
SourceNode getASourceProp() {
exists(Node base, Node key |
dynamicPropReadStep(base, key, result) and
AccessPath::getAnAliasedSourceNode(getSourceObject()).flowsTo(base) and
getASourceObjectRef().flowsTo(base) and
key.getImmediatePredecessor*() = this
)
}
@@ -117,7 +124,7 @@ class EntriesEnumeratedPropName extends EnumeratedPropName {
* Holds if the properties of `node` are enumerated locally.
*/
predicate arePropertiesEnumerated(DataFlow::SourceNode node) {
node = AccessPath::getAnAliasedSourceNode(any(EnumeratedPropName name).getSourceObject())
node = any(EnumeratedPropName name).getASourceObjectRef()
}
/**