Brian Ng
c8c71684c4
Don't consume async when checking for async func decl ( #377 )
2017-03-01 12:11:48 -05:00
Henry Zhu
f1e2cca767
Add back ranges property ( #363 )
...
* Add back ranges property
* Correctly adjust range in flow plugin
* Make it an option
2017-03-01 10:57:06 -05:00
Andrew Levine
aec4beff0c
Don't parse class properties without initializers when classProperties is disabled and Flow is enabled ( #300 )
2017-03-01 11:55:24 +01:00
Henry Zhu
5e0cce4974
Merge branch 'master' into 7.0
2017-02-28 14:37:13 -05:00
Brian Ng
09bb9bc6be
Fix parsing yield with dynamicImport ( #383 )
2017-02-28 12:43:34 -05:00
Henry Zhu
8d90dc0d10
[7.0] Change RestProperty/SpreadProperty to RestElement/SpreadElement ( #384 )
...
* [7.0] Change RestProperty/SpreadProperty to RestElement/SpreadElement
* Fix rest element in array pattern at invalid location
2017-02-28 12:31:58 -05:00
Brian Ng
cd133ff8e1
Ensure consistent start args for parseParenItem ( #386 )
2017-02-28 12:56:56 +01:00
Henry Zhu
2dd57d17b9
Revert "Fix export default async function to be FunctionDeclaration" ( #375 )
2017-02-23 09:50:33 -05:00
Henry Zhu
b0f8405b52
Revert "Don't parse class properties without initializers when classProperties plugin is disabled, and Flow is enabled" ( #376 )
2017-02-23 09:50:25 -05:00
Kevin Gibbons
561d4f74b0
Forbid semicolons after decorators in classes ( #352 )
2017-02-22 16:24:40 +01:00
Brian Ng
ad8d520406
Ensure takeDecorators is called on exported class ( #358 )
2017-02-22 16:22:38 +01:00
Daniel Tschinder
7bf553a575
Merge branch 'master' into 7.0
2017-02-20 23:49:27 +01:00
Daniel Tschinder
b023470c7e
estree: correctly change literals in all cases ( #368 )
2017-02-20 23:47:57 +01:00
Daniel Tschinder
50ffa49201
Merge branch 'master' into 7.0
...
# Conflicts:
# src/plugins/flow.js
2017-02-20 22:47:17 +01:00
Daniel Tschinder
2ef00a6631
Fix negative number literal typeannotations ( #366 )
...
* Fix negative number literal typeannotations
Also use parseLiteral() to parser string and number literal typeannotations
so that future changes (estree) to literals are also reflected to flow.
* Instead of invalid fallthrough throw immediately
* Increase coverage and better error mesage
2017-02-20 22:43:59 +01:00
Daniel Tschinder
d88befdd30
Merge branch 'master' into 7.0
...
# Conflicts:
# src/parser/index.js
2017-02-12 13:32:06 +01:00
Daniel Tschinder
1cca7000d1
Reintroduce Variance node ( #333 )
...
* Reintroduce Variance node
* Optimize code and coverage
tt.plusMin can only be + or - so no need to have an elseif
2017-02-12 13:28:14 +01:00
Charles Pick
cd3f14921e
Rename NumericLiteralTypeAnnotation to NumberLiteralTypeAnnotation ( #332 )
2017-02-12 13:14:35 +01:00
Daniel Tschinder
fac13290d7
Estree compatibility as plugin ( #277 )
...
* Initial estree support for ClassMethod
* Handle literals for estree
* Fix regex
* correct output of regexp and regenerate test
* Add tests for validation stuff with estree plugin
* Parse Properties correctly
This also refactors how babylon parses obj properties in general
so that this logic can be more easily extended.
* Run all throws-tests a second time with estree plugin
* Fix all throw tests
* Remove rebase conflict
* Correctly set kind
This ensures state.inMethod gets propagated correctly
* Add computed: false to methods with ident async
* Implement directive field on Directives
* Test invalid directives
* more tests
2017-02-12 12:48:41 +01:00
Daniel Tschinder
c79dd953ea
Fix #304 and #309 ( #339 )
2017-02-10 15:36:46 +01:00
Raphael Mu
f25a2fbc78
add startLine option ( #346 )
2017-02-10 15:06:28 +01:00
Daniel Tschinder
407c97c9c2
Fix #321 by allowing question marks in type params ( #338 )
...
* Fix #321 by allowing question marks in type params
* Require commas between params
2017-02-10 15:03:15 +01:00
Daniel Tschinder
bc771bd0f9
Fix #336 by correctly setting arrow-param ( #337 )
2017-02-10 15:01:39 +01:00
Daniel Tschinder
4bd682e90b
keywords are not allowed as local specifier ( #307 )
...
Also fix some error messages to be more specific
2017-02-10 14:58:44 +01:00
Panagiotis Vekris
e049ec3456
[Flow] Function predicate declaration ( #103 )
...
* [Flow] Function predicate declaration
The accepted syntax for function declarations is extended to allow
the following predicate declaration:
FunctionReturnType :=
Type
Predicate
Type Predicate
Predicate :=
%checks
%checks ( ConditionalExpression )
* [Flow] Minor tweaks and more examples to function predicates
* [Flow] Clean-up and better message for function predicates
* [Flow] Adding abstract function predicate example
* [Flow] Rearranging the `predicate` field to ease babel generator.
2017-02-10 14:55:13 +01:00
Brandon Dail
56928dca66
[7.0] Remove ForAwaitStatement, add await flag to ForOfStatement ( #349 )
...
* Remove ForAwaitStatement, add await flag to ForOfStatement
* Set await flag for all ForOfStatements
2017-02-09 17:37:03 -05:00
Daniel Tschinder
0309a5ba8a
Merge branch 'master' into 7.0
...
# Conflicts:
# src/parser/statement.js
# src/plugins/jsx/index.js
2017-01-27 23:12:20 +01:00
Daniel Tschinder
e614032504
Change location of ObjectTypeIndexer to match flow ( #228 )
2017-01-27 23:08:20 +01:00
jeromew
898c4a7623
Add a parseExpression public method ( #213 )
2017-01-27 20:13:02 +01:00
Daniel Tschinder
d2faddf0d9
Fix export default async function to be FunctionDeclaration ( #324 )
2017-01-27 19:43:06 +01:00
Toru Kobayashi
c424156751
Rename flow AST Type ExistentialTypeParam to ExistsTypeAnnotation ( #322 )
2017-01-27 19:42:15 +01:00
Andrew Levine
9929baaca8
Don't parse class properties without initializers when classProperties is disabled and Flow is enabled ( #300 )
2017-01-23 23:56:39 +01:00
Daniel Tschinder
b6c3b5aa83
Cleanup and splitup parser functions ( #295 )
...
This makes it easier to integrate the estree plugin.
2017-01-20 23:52:16 +01:00
Daniel Tschinder
0a00aff2fe
Do not allow overwritting of primitive types ( #314 )
...
* Do not allow overwritting of primitive types
* Better name for method
2017-01-20 22:22:25 +01:00
Brian Ng
461ed45942
Fix parse error when destructuring set with default value ( #317 )
2017-01-20 22:21:40 +01:00
Daniel Tschinder
55df6631fa
Address comments on flow type imports ( #312 )
2017-01-20 22:20:13 +01:00
Daniel Tschinder
d5cd2c3231
Allow imports in declare module ( #315 )
...
* Allow imports in declare module {}
* Rename bodyElement to bodyNode
2017-01-20 22:19:50 +01:00
Daniel Tschinder
999b655ca6
Disallow import type { type a } from … ( #305 )
2017-01-17 20:34:20 +01:00
Daniel Tschinder
bd001767fb
Revert "Temporary rollback for erroring on trailing comma with spread ( #154 )" ( #290 )
...
This reverts commit 5bac6e8ad99bcbf608f6df30d9942d6269f88fac.
2017-01-16 10:50:51 +01:00
Brian Ng
c5462e1a30
Remove classConstructorCall plugin ( #291 )
2017-01-16 10:49:42 +01:00
Dan Harper
28c467e8fe
Fix ObjectTypeCallProperty static ( #298 )
...
* add failing test for ObjectTypeCallProperty static (#297 )
* fix ObjectTypeCallProperty static
2017-01-16 10:42:13 +01:00
Gabriel Peña
00f03bb3b0
Remove '*' as a plugin option ( #301 )
2017-01-16 10:34:23 +01:00
Daniel Tschinder
5977479f57
Call inner function instead of 1:1 copy to plugin ( #294 )
2017-01-16 10:21:44 +01:00
greenkeeper[bot]
68a173c97c
Update eslint-config-babel to the latest version 🚀 ( #299 )
...
* chore(package): update eslint-config-babel to version 6.0.0
https://greenkeeper.io/
* Fix linting
2017-01-15 11:12:49 +01:00
Brian Ng
9d78213ab6
Improve error message on attempt to destructure named import ( #288 )
2017-01-14 15:38:30 +01:00
Daniel Tschinder
b918554d73
Correct indent eslint rule config ( #276 )
...
* Change indent rule to correctly lint
* Remove rule again
2017-01-14 15:11:50 +01:00
greenkeeper[bot]
62d1970f77
Update eslint-config-babel to the latest version 🚀 ( #293 )
...
* chore(package): update eslint-config-babel to version 5.0.0
https://greenkeeper.io/
* fix lint warnings
2017-01-14 15:04:10 +01:00
Daniel Tschinder
5785f0ce72
Merge branch 'master' into 7.0
2017-01-12 22:42:25 +01:00
Sven SAULEAU
ed13a4ab05
Refactor tokenizer types file ( #263 )
...
* refactor(tokenizer): use class for keywork tokens
* refactor(tokenizer): re-use constacts in types
* refactor(tokenizer): binop token type
* feat(tokenizer): use beforeAndStartExpr for shortcut
* fix(tokenizer): typo in keywordTokenType
* refactor(tokenizer): don't use spread operator
* refactor(tokenizer): constant for isLoop, isAssign, prefix, postfix
* fix(tokenizer): remove constant beforeAndStartExpr
* style(tokenizer): space after comma
2017-01-10 20:22:56 +01:00
Mathias Bynens
ed625cb2e1
Remove String.fromCodePoint shim ( #279 )
...
This is not necessary anymore if we drop support for Node.js v0.10 and v0.12.
Ref. https://github.com/babel/babel/issues/4315 .
2017-01-10 20:14:11 +01:00