Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 79e2a75

Browse files
committed
JS: Allow more kinds of expectation comments
1 parent 2f2c9f8 commit 79e2a75

1 file changed

Lines changed: 12 additions & 4 deletions

File tree

javascript/ql/lib/utils/test/internal/InlineExpectationsTestImpl.qll

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,22 @@ private import codeql.util.test.InlineExpectationsTest
44
module Impl implements InlineExpectationsTestSig {
55
private import javascript
66

7-
final private class LineCommentFinal = LineComment;
7+
final class ExpectationComment = ExpectationCommentImpl;
88

9-
class ExpectationComment extends LineCommentFinal {
10-
string getContents() { result = this.getText() }
9+
class Location = JS::Location;
10+
11+
abstract private class ExpectationCommentImpl extends Locatable {
12+
abstract string getContents();
1113

1214
/** Gets this element's location. */
1315
Location getLocation() { result = super.getLocation() }
1416
}
1517

16-
class Location = JS::Location;
18+
private class JSComment extends ExpectationCommentImpl instanceof Comment {
19+
override string getContents() { result = super.getText() }
20+
}
21+
22+
private class HtmlComment extends ExpectationCommentImpl instanceof HTML::CommentNode {
23+
override string getContents() { result = super.getText() }
24+
}
1725
}

0 commit comments

Comments
 (0)