Skip to content

Commit 3ed92a0

Browse files
committed
Fix the case when the argument is not a Literal.
1 parent d87556b commit 3ed92a0

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/findTokens.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ module.exports = (
4040
CallExpression: (path) => {
4141
if (path.node.callee.name === 'getDataElementValue') {
4242
const tokenNameNode = path.node.arguments[0];
43-
tokens.push(tokenNameNode.value);
43+
tokens.push(tokenNameNode.name || tokenNameNode.value);
4444
}
4545
}
4646
});

test/fixtures/findTokens/container.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ module.exports = (getDataElementValues) => ({
146146
const y6 = 'some getDataElementValue(\'core560\')';
147147
getDataElementValue('core561');
148148
getDataElementValue('core562');
149-
149+
getDataElementValue(reactor00650032);
150150
//getDataElementValue('commented');
151151

152152
const z = 5 + getDataElementValue('core');

0 commit comments

Comments
 (0)