JS: Workaround ascii PR check

This commit is contained in:
Asger Feldthaus
2020-10-14 18:08:36 +01:00
parent b3d8b95433
commit 4337c5adaf
2 changed files with 82 additions and 3 deletions

View File

@@ -198,13 +198,20 @@ module Angular2 {
}
}
private string getInternalName(string name) {
exists(Identifier id |
result = id.getName() and
name = result.regexpCapture("\\u0275(DomAdapter|getDOM)", 1)
)
}
/** Gets a reference to a `DomAdapter`, which provides acess to raw DOM elements. */
private DataFlow::SourceNode domAdapter() {
// Note: these are internal properties, prefixed with the theta character "ɵ".
// Note: these are internal properties, prefixed with the "latin small letter barred O (U+0275)" character.
// Despite being internal, some codebases do access them.
result.hasUnderlyingType("@angular/common", "ɵDomAdapter")
result.hasUnderlyingType("@angular/common", getInternalName("DomAdapter"))
or
result = DataFlow::moduleImport("@angular/common").getAMemberCall("ɵgetDOM")
result = DataFlow::moduleImport("@angular/common").getAMemberCall(getInternalName("getDOM"))
}
/** A reference to the DOM location obtained through `DomAdapter.getLocation()`. */