CodeQL library for JavaScript/TypeScript
codeql/javascript-all 0.8.12 (changelog, source)
Search

Member predicate MaybeDirective::getDirectiveText

Gets the raw text of the string literal wrapped by this statement.

The surrounding quotes are removed, but escape sequences are not interpreted. For example, the text of the directive

'use strict';

is use strict, while the text of the directive

"use\x20strict";

is use\x20strict. (Note in particular that the latter is not a valid strict mode declaration, even though the value of the string literal is the same as in the former case.)

string getDirectiveText()