@@ -8,26 +8,24 @@ module StringOps {
88 /**
99 * A expression that is equivalent to `A.startsWith(B)` or `!A.startsWith(B)`.
1010 */
11- class StartsWith extends DataFlow:: Node {
12- StartsWith ( ) { this instanceof StartsWith:: Range }
13-
11+ class StartsWith extends DataFlow:: Node instanceof StartsWith:: Range {
1412 /**
1513 * Gets the `A` in `A.startsWith(B)`.
1614 */
17- DataFlow:: Node getBaseString ( ) { result = this . ( StartsWith :: Range ) .getBaseString ( ) }
15+ DataFlow:: Node getBaseString ( ) { result = super .getBaseString ( ) }
1816
1917 /**
2018 * Gets the `B` in `A.startsWith(B)`.
2119 */
22- DataFlow:: Node getSubstring ( ) { result = this . ( StartsWith :: Range ) .getSubstring ( ) }
20+ DataFlow:: Node getSubstring ( ) { result = super .getSubstring ( ) }
2321
2422 /**
2523 * Gets the polarity of the check.
2624 *
2725 * If the polarity is `false` the check returns `true` if the string does not start
2826 * with the given substring.
2927 */
30- boolean getPolarity ( ) { result = this . ( StartsWith :: Range ) .getPolarity ( ) }
28+ boolean getPolarity ( ) { result = super .getPolarity ( ) }
3129 }
3230
3331 module StartsWith {
@@ -235,26 +233,24 @@ module StringOps {
235233 /**
236234 * An expression that is equivalent to `A.endsWith(B)` or `!A.endsWith(B)`.
237235 */
238- class EndsWith extends DataFlow:: Node {
239- EndsWith ( ) { this instanceof EndsWith:: Range }
240-
236+ class EndsWith extends DataFlow:: Node instanceof EndsWith:: Range {
241237 /**
242238 * Gets the `A` in `A.startsWith(B)`.
243239 */
244- DataFlow:: Node getBaseString ( ) { result = this . ( EndsWith :: Range ) .getBaseString ( ) }
240+ DataFlow:: Node getBaseString ( ) { result = super .getBaseString ( ) }
245241
246242 /**
247243 * Gets the `B` in `A.startsWith(B)`.
248244 */
249- DataFlow:: Node getSubstring ( ) { result = this . ( EndsWith :: Range ) .getSubstring ( ) }
245+ DataFlow:: Node getSubstring ( ) { result = super .getSubstring ( ) }
250246
251247 /**
252248 * Gets the polarity if the check.
253249 *
254250 * If the polarity is `false` the check returns `true` if the string does not end
255251 * with the given substring.
256252 */
257- boolean getPolarity ( ) { result = this . ( EndsWith :: Range ) .getPolarity ( ) }
253+ boolean getPolarity ( ) { result = super .getPolarity ( ) }
258254 }
259255
260256 module EndsWith {
@@ -658,37 +654,35 @@ module StringOps {
658654 * if (!match) { ... } // <--- 'match' is the RegExpTest
659655 * ```
660656 */
661- class RegExpTest extends DataFlow:: Node {
662- RegExpTest ( ) { this instanceof RegExpTest:: Range }
663-
657+ class RegExpTest extends DataFlow:: Node instanceof RegExpTest:: Range {
664658 /**
665659 * Gets the AST of the regular expression used in the test, if it can be seen locally.
666660 */
667661 RegExpTerm getRegExp ( ) {
668662 result = getRegExpOperand ( ) .getALocalSource ( ) .( DataFlow:: RegExpCreationNode ) .getRoot ( )
669663 or
670- result = this . ( RegExpTest :: Range ) .getRegExpOperand ( true ) .asExpr ( ) .( StringLiteral ) .asRegExp ( )
664+ result = super .getRegExpOperand ( true ) .asExpr ( ) .( StringLiteral ) .asRegExp ( )
671665 }
672666
673667 /**
674668 * Gets the data flow node corresponding to the regular expression object used in the test.
675669 *
676670 * In some cases this represents a string value being coerced to a RegExp object.
677671 */
678- DataFlow:: Node getRegExpOperand ( ) { result = this . ( RegExpTest :: Range ) .getRegExpOperand ( _) }
672+ DataFlow:: Node getRegExpOperand ( ) { result = super .getRegExpOperand ( _) }
679673
680674 /**
681675 * Gets the data flow node corresponding to the string being tested against the regular expression.
682676 */
683- DataFlow:: Node getStringOperand ( ) { result = this . ( RegExpTest :: Range ) .getStringOperand ( ) }
677+ DataFlow:: Node getStringOperand ( ) { result = super .getStringOperand ( ) }
684678
685679 /**
686680 * Gets the return value indicating that the string matched the regular expression.
687681 *
688682 * For example, for `regexp.exec(str) == null`, the polarity is `false`, and for
689683 * `regexp.exec(str) != null` the polarity is `true`.
690684 */
691- boolean getPolarity ( ) { result = this . ( RegExpTest :: Range ) .getPolarity ( ) }
685+ boolean getPolarity ( ) { result = super .getPolarity ( ) }
692686 }
693687
694688 /**
0 commit comments