mirror of
https://github.com/github/codeql.git
synced 2026-04-23 07:45:17 +02:00
JS: Allow more kinds of expectation comments
This commit is contained in:
@@ -4,14 +4,22 @@ private import codeql.util.test.InlineExpectationsTest
|
||||
module Impl implements InlineExpectationsTestSig {
|
||||
private import javascript
|
||||
|
||||
final private class LineCommentFinal = LineComment;
|
||||
final class ExpectationComment = ExpectationCommentImpl;
|
||||
|
||||
class ExpectationComment extends LineCommentFinal {
|
||||
string getContents() { result = this.getText() }
|
||||
class Location = JS::Location;
|
||||
|
||||
abstract private class ExpectationCommentImpl extends Locatable {
|
||||
abstract string getContents();
|
||||
|
||||
/** Gets this element's location. */
|
||||
Location getLocation() { result = super.getLocation() }
|
||||
}
|
||||
|
||||
class Location = JS::Location;
|
||||
private class JSComment extends ExpectationCommentImpl instanceof Comment {
|
||||
override string getContents() { result = super.getText() }
|
||||
}
|
||||
|
||||
private class HtmlComment extends ExpectationCommentImpl instanceof HTML::CommentNode {
|
||||
override string getContents() { result = super.getText() }
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user