Skip to content

Commit

Permalink
fix comment regarding invalid annotation handling
Browse files Browse the repository at this point in the history
  • Loading branch information
kzc committed May 14, 2021
1 parent c40d206 commit e575d47
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/utils/pureComments.ts
Expand Up @@ -32,8 +32,11 @@ function isOnlyWhitespaceOrComments(code: string) {
const ast = acorn.parse(code, { ecmaVersion: 'latest' }) as any;
return ast.body && ast.body.length === 0;
} catch {
// should never be reached -
// the entire module was previously successfully parsed
// should only be reached by invalid annotations like:
//
// foo() /*@__PURE__*/ /* other */, bar();
//
// where `code` is " /* other */, "
}
return false;
}
Expand Down

0 comments on commit e575d47

Please sign in to comment.