Skip to content

Commit

Permalink
Add comment
Browse files Browse the repository at this point in the history
  • Loading branch information
danez committed Apr 26, 2019
1 parent 39d06a3 commit 32ed491
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/utils/printValue.js
Expand Up @@ -35,6 +35,9 @@ function getSrcFromAst(path: NodePath): string {
*/
export default function printValue(path: NodePath): string {
if (path.node.start == null) {
// This only happens when we use AST builders to create nodes that do not actually
// exist in the source (e.g. when resolving Object.keys()). We might need to enhance
// this if we start using builders from `ast-types` more.
if (path.node.type === 'Literal') {
return `"${path.node.value}"`;
}
Expand Down

0 comments on commit 32ed491

Please sign in to comment.