* Slightly simplify logic
* Implement ES2016 check for simple parameter list in strict mode
See e.g. ECMA-262 7.0 14.1.2:
> It is a Syntax Error if ContainsUseStrict of FunctionBody is true and
> IsSimpleParameterList of FormalParameters is false.
Similar clauses cover arrow functions, generator functions, methods, and
generator methods, as well as async functions and async arrow functions.
* exact object type annotations for Flow plugin
* Couple tweaks per suggestions
* s/==/===/
* add test for unexpected token in flowObjectType Semicolon
This makes declare class extends behave the same way as in flow
The ast-token after the extends keyword, might be either Identifier or
QualifiedTypeIdentifier
To do that this commits splits the parseGenericType into two functions,
one for parsing genericType and on for qualifiedTypeIdentifier
Flow's "toAssignable" override wasn't calling the inner function,
resulting in the destructuring in an AssignmentPattern not having the
node type changed from ObjectExpression to ObjectPattern, resulting in
"Binding rvalue" thrown from "checkLVal()"
* This removes the exponentiationOperator as it is now in es2016
* Remove from tests
* Remove asyncFunctions and restructure test dirs
* Remove trailingFunctionCommas
This commit e6c11a0 (#19) made a big performance regression.
The reason was that parseConditional was always cloning the current state
even if no question mark (potential conditional or flow-optional
token) was at the current position.
Simply checking if questionmark matches the current token solves the problem.
Fixes#62
The cloning caused comments that where added to the original node to be persisted into
the cloned node.
Espree/Acorn does not have any cloning, that's why it is working there.
This change omits comments when cloning, as removing the cloning
causes tests in babel to fail.
The primary goal of this commit is to add the ability to parse type parameter
declarations with defaults, like `type Foo<T = string> = T`. While I was in the
code, I fixed a few small things, like
* Type parameter declarations need 1 or more type parameters.
* The existential type `*` is not a valid type parameter.
* The existential type `*` is a primary type
* The param list for type parameter declarations now consists of
`TypeParameter` nodes
This fixes an issue that comments were added as leading comments
to expressions, which are not immediately folowing the comment.
This was also reported and fixed in espree, and is basically a port to
babylon. eslint/espree#256
this also fixes an issue in babel-eslint with certain rules babel/babel-eslint#289