Skip to content

Commit dde4932

Browse files
authored
Merge pull request #7003 from asgerf/js/mixed-this-fp
Approved by erik-krogh
2 parents 1c78c79 + d52b2bd commit dde4932

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

javascript/ql/src/Declarations/MixedStaticInstanceThisAccess.ql

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
import javascript
1313

1414
/** Holds if `base` declares or inherits method `m` with the given `name`. */
15-
predicate hasMethod(ClassDefinition base, string name, MethodDefinition m) {
15+
predicate hasMethod(ClassDefinition base, string name, MethodDeclaration m) {
1616
m = base.getMethod(name) or
1717
hasMethod(base.getSuperClassDefinition(), name, m)
1818
}
@@ -22,7 +22,7 @@ predicate hasMethod(ClassDefinition base, string name, MethodDefinition m) {
2222
* where `fromMethod` and `toMethod` are of kind `fromKind` and `toKind`, respectively.
2323
*/
2424
predicate isLocalMethodAccess(
25-
PropAccess access, MethodDefinition fromMethod, string fromKind, MethodDefinition toMethod,
25+
PropAccess access, MethodDefinition fromMethod, string fromKind, MethodDeclaration toMethod,
2626
string toKind
2727
) {
2828
hasMethod(fromMethod.getDeclaringClass(), access.getPropertyName(), toMethod) and
@@ -32,7 +32,7 @@ predicate isLocalMethodAccess(
3232
toKind = getKind(toMethod)
3333
}
3434

35-
string getKind(MethodDefinition m) {
35+
string getKind(MethodDeclaration m) {
3636
if m.isStatic() then result = "static" else result = "instance"
3737
}
3838

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
abstract class Q {
2+
abstract test();
3+
static test() {}
4+
5+
method() {
6+
this.test(); // OK
7+
}
8+
}

0 commit comments

Comments
 (0)