JS: More qldoc

This commit is contained in:
Asger F
2019-11-08 10:00:24 +00:00
parent dc6c15cbb9
commit 2242df920f
2 changed files with 9 additions and 1 deletions

View File

@@ -410,7 +410,12 @@ class BigIntLiteral extends @bigintliteral, Literal {
class StringLiteral extends @stringliteral, Literal {
override string getStringValue() { result = getValue() }
/** Gets the value of this string literal parsed as a regular expression. */
/**
* Gets the value of this string literal parsed as a regular expression, if possible.
*
* All string literals have an associated regular expression tree, provided it can
* be parsed without syntax errors.
*/
RegExpTerm asRegExp() { this = result.getParent() }
}

View File

@@ -855,6 +855,9 @@ abstract class RegExpPatternSource extends DataFlow::Node {
*/
abstract DataFlow::SourceNode getARegExpObject();
/**
* Gets the root term of the regular expression parsed from this pattern.
*/
abstract RegExpTerm getRegExpTerm();
}