This website requires JavaScript.
Explore
Help
Sign In
vitalif
/
prettier
Watch
1
Star
0
Fork
You've already forked prettier
0
Code
Issues
Pull Requests
Releases
Wiki
Activity
1916966910
prettier
/
tests
/
comments_closure_typecast
/
jsfmt.spec.js
2 lines
32 B
JavaScript
Raw
Normal View
History
Unescape
Escape
Fix closure compiler type casts (#5947) * Fix closure compiler type casts This fixes casts when they are followed by a closing parenthesis, eg: ```js foo( /** @type {!Array} */(arrOrString).length ); ``` The old code would see the `CallExpresion`'s closing `)` and assume the typecast belonged to the `MemberExpression`, not the `arrOrString` `Identifier`. This would be easier to accomplish if every AST would tell us if the expression were parenthesized. If they did, we could check that the node were parenthesized and either it or an ancestor has a typecast, stopping when we find an ancestor is itself parenthesized. * More tests, and changelog * Fix while loop * Update changelog * Update CHANGELOG.unreleased.md * Use babel's parenthesized information * Cleanup call
2019-04-26 20:05:57 +03:00
run
_spec
(
_
_dirname
,
[
"babel"
]
)
;