10000 JS: Add class harness to recover localFieldStep edges by asgerf · Pull Request #18302 · github/codeql · GitHub
[go: up one dir, main page]

Skip to content

JS: Add class harness to recover localFieldStep edges #18302

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
JS: Add test for flow from constructor to method
  • Loading branch information
asgerf committed Dec 9, 2024
commit 6c1ec8c3a3a13e16bd8d7cb502b933f4173e349f
40 changes: 40 additions & 0 deletions javascript/ql/test/library-tests/TripleDot/class-harness.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
import 'dummy';

function h1() {
class C {
constructor(arg) {
this.x = source("h1.1")
}
method() {
sink(this.x); // $ MISSING: hasValueFlow=h1.1
}
}
}

function h2() {
class C {
method1() {
this.x = source("h2.1")
}
method2() {
sink(this.x); // $ MISSING: hasValueFlow=h2.1
}
}
}

function h3() {
class C {
constructor(arg) {
this.x = arg;
}
method1() {
sink(this.x); // $ hasValueFlow=h3.2
}
method2() {
sink(this.x); // $ hasValueFlow=h3.3
}
}
new C(source("h3.1"));
new C(source("h3.2")).method1();
new C(source("h3.3")).method2();
}
0