Skip to content

Commit

Permalink
visitor(calculate-constant-exp): fix bug
Browse files Browse the repository at this point in the history
Signed-off-by: echo094 <[email protected]>
  • Loading branch information
echo094 committed Aug 5, 2024
1 parent a72e5d7 commit f57e33f
Showing 1 changed file with 0 additions and 1 deletion.
1 change: 0 additions & 1 deletion src/visitor/calculate-constant-exp.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ function calculateBinaryExpression(path) {
const code = generator(path.node).code
try {
const ret = eval(code)
path.replaceWithSourceString(ret)
// The strings cannot use replaceWithSourceString
// For example, string "ab" will be parsed as identifier ab
if (typeof ret === 'string') {
Expand Down

0 comments on commit f57e33f

Please sign in to comment.