github / github/codeql

Presenting ... within the result of toString() for both DataFlow::Node and Expr for JavaScript

Ouverte
#5,531 2 commentaires 0 réactions 0 personnes assignées Voir sur GitHub
question
Langage dominant
CodeQL
Étoiles
10.1k
Forks
2.1k
Merge moyen
2 j 15 h
PR mergées (30 j)
141

Description

**Description of the issue**

I tried to retrieve the text presentation of specific `DataFlow::Node` and `Expr`, while the results are all default to abbreviated strings, such as `require('body-parser')` which is supposed to be a `DataFlow::ImportModuleNode` in source code, the result of `toString()` is `require ... arser')`.

[`https://github.com/github/codeql/issues/4811`](https://github.com/github/codeql/issues/4811), this issue had provided a solution of using `getStringValue()` instead of `toString()`, while it seems this solution is only applicable to Literal objects instead of retrieving text presentation of all `DataFlow::Node` and `Expr`.

Is there any proper way to retrieve the full text of nodes and exprs?

Many thanks!

Guide de contribution

Ouvrir le guide de contribution

Évaluation

Cette issue n'a pas encore été évaluée.

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.