Skip to content

Commit 8ef5736

Browse files
authored
Merge pull request github#6278 from erik-krogh/toUnicodeInAngular
Approved by asgerf
2 parents b14139f + 73491d8 commit 8ef5736

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

javascript/ql/src/semmle/javascript/frameworks/Angular2.qll

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -216,20 +216,13 @@ module Angular2 {
216216
}
217217
}
218218

219-
private string getInternalName(string name) {
220-
exists(Identifier id |
221-
result = id.getName() and
222-
name = result.regexpCapture("\\u0275(DomAdapter|getDOM)", 1)
223-
)
224-
}
225-
226219
/** Gets a reference to a `DomAdapter`, which provides acess to raw DOM elements. */
227220
private DataFlow::SourceNode domAdapter() {
228221
// Note: these are internal properties, prefixed with the "latin small letter barred O (U+0275)" character.
229222
// Despite being internal, some codebases do access them.
230-
result.hasUnderlyingType("@angular/common", getInternalName("DomAdapter"))
223+
result.hasUnderlyingType("@angular/common", 629.toUnicode() + "DomAdapter")
231224
or
232-
result = DataFlow::moduleImport("@angular/common").getAMemberCall(getInternalName("getDOM"))
225+
result = DataFlow::moduleImport("@angular/common").getAMemberCall(629.toUnicode() + "getDOM")
233226
}
234227

235228
/** A reference to the DOM location obtained through `DomAdapter.getLocation()`. */

0 commit comments

Comments
 (0)