Commit Graph

4 Commits (master)

Author SHA1 Message Date
fisker Cheung 179943ccba Update `@babel/parser` to v7.6.3 (#6386)
* fix flow_function_parentheses

* fix directives

* fix classes

* fix flow_method

* fix `do`

* fix `decorators`

* fix `comments_closure_typecast`

* fix `comments`

* fix `flow_internal_slot`

* fix `flow_comments`

* fix `flow_type_declarations`

* fix `flow_type_spread`

* fix `functional_composition`

* fix `multiparser_js_css`

* fix `no-semi`

* fix `objects`

* fix `template`

* fix `yield`

* update `flow_method` snap

* fix `empty_paren_comment`

* fix `mdx`

* fix `object_property_comment`

* Update `@babel/parser`

* Update @babel/parser to v7.6.2

* Update yarn.lock

* fix `nullish_coalescing` test

* fix `flow_class_field` test

* fix snapshot

* @babel/parser v7.6.3

* fix tests

* update snap
2019-10-09 14:52:11 +03:00
Justin Ridgewell 4fda7af783 Fix closure type cast without spaces (#6116)
* Fix closure type cast without spaces

Closure typecasts don't require a space between the `@type` and opening `{`.

* More tests, and add a changelog entry
2019-05-14 10:14:52 -03:00
Yang Su 54b7655dab Improved multiline closure comment detection (#6070) 2019-05-07 07:30:07 -03:00
Justin Ridgewell c085aeb152 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 13:05:57 -04:00