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
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
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
Brian Ng
461ed45942
Fix parse error when destructuring set with default value ( #317 )
2017-01-20 22:21:40 +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
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
Gabriel Peña
00f03bb3b0
Remove '*' as a plugin option ( #301 )
2017-01-16 10:34:23 +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]
6773279039
Update eslint-config-babel to the latest version 🚀 ( #273 )
...
* chore(package): update eslint-config-babel to version 4.0.0
https://greenkeeper.io/
* Fix prefer-const
* Update package.json
2017-01-10 19:42:43 +01:00
Vladimir Kurchatkin
3267e5f365
Don't set inType flag when parsing property names ( #266 )
...
* Don't set inType flag when parsing property names
* Add inPropertyName type definition
* Move inPropertyName check before this.curContext()
2017-01-05 12:25:57 +01:00
Jeff Morrison
9ea4e9dead
Add support for Flow shorthand import type ( #267 )
2017-01-03 10:52:18 +01:00
Alex Rattray
68bb1c6598
Allow this.state.clone() when parsing decorators ( #262 )
...
Adding the line `this.state = this.state.clone();` in a parser plugin
(specifically, in my case `parseExprAtom`)
would break decorators.
This change fixes that.
2017-01-02 10:37:05 +01:00
Andrew Levine
30545e883f
Freeze current plugins list for "*" option, and remove from README.md ( #245 )
2016-12-06 14:09:36 -05:00
Kai Cataldo
5fb4353778
Throw error when exporting non-declaration ( #241 )
...
* Throw error when exporting non-declaration
fixes #238
* Do check ahead of parsing export statement
2016-12-01 21:03:13 +01:00
Daniel Tschinder
6d3b63454c
Allow plugins:["*"] ( #229 )
2016-11-17 19:04:58 -05:00
Kai Cataldo
e260381e06
Throw error for reserved words enum and await ( #195 )
...
* Throw error for reserved words enum and await when source type is module
* Extract reserved word check into method
* Fix tests
2016-11-09 16:29:02 +01:00
Andrew Levine
beb8db6264
Use rollup for bundling to speed up startup time ( #190 )
2016-10-26 10:44:21 -04:00
Andrew Levine
01e984fd0f
Allow "async" as identifier for object literal property shorthand ( #187 )
2016-10-17 10:33:18 -04:00
Moti Zilberman
9b6e243736
Raise error on duplicate definition of __proto__ ( #183 )
...
Spec: http://www.ecma-international.org/ecma-262/6.0/#sec-__proto__-property-names-in-object-initializers
This brings back to life a bit of dead code in Parser.prototype.checkPropClash, and enables several tests that were previously disabled.
2016-10-16 15:16:38 +02:00
Moti Zilberman
7c18bf83cc
Increase test coverage ( #175 )
...
* Increase test coverage
* Test for error when binding `this` in destructuring pattern
* Ignore coverage of inAsync check in parseAwait - already checked externally
* Ignore coverage of default case in checkPropClash
* Remove unused parameter isAsync from parseParenAndDistinguishExpression
* Ignore coverage of an `else` branch in flowParseTypeParameterDeclaration
* Flow: remove unused parameters to flowParseTypeAnnotatableIdentifier
* Flow: ignore coverage of pass-through throw statement in parseConditional
* Flow: Add test for error on property with type param
* Flow: ignore coverage of pass-through throw statements in parseMaybeAssign, parseArrow
* Add test for error on XML-style comment in module code
* Update test for error on method in object pattern
* Test for error: "Only '=' operator can be used for specifying default value"
2016-10-16 15:04:13 +02:00
Moti Zilberman
b5877f04b1
Fix up #172 ( #177 )
...
* Update two esprima tests to the new "expected TOKEN" messages
* Update dynamic-import to use "expected (" error message
2016-10-14 16:50:07 -04:00
Henry Zhu
9ecf763218
lint [skip ci]
2016-10-14 16:12:05 -04:00
Moti Zilberman
d3af158ba5
Annotate more errors with expected token ( #172 )
...
Expanding on #150 , this allows `unexpected()` to accept the expected token type instead of a message string.
This overload is then used in a couple more places (that independently implement a logic similar to `expect()`'s) to construct an `Unexpected token, expected FOO` message.
2016-10-14 16:10:09 -04:00
Jordan Gensler
c63c1bc728
[dynamic-import] Implementing import() syntax ( #163 )
2016-10-14 14:54:21 -04:00
Daniel Tschinder
4c445fd5f8
Remove kcheck ( #173 )
2016-10-14 12:12:55 -04:00
Daniel Tschinder
b31834ad29
Allow typeAnnotations for yield epressions ( #174 )
2016-10-14 12:07:46 -04:00
Jeroen Engels
e14f93d1bb
Fix crash when exporting with destructuring and sparse array ( #170 )
...
* Create reproducible crash when exporting with destructuring and sparse array
* Fix crash when exporting with destructuring and sparse array
2016-10-12 19:36:08 -04:00
Daniel Tschinder
d4d6d05d25
Slightly better error messages ( #150 )
...
* Slightly better errors
Instead of "Unexpected token" we now print
"Unexpected token, expected <type.label>"
2016-10-12 10:38:26 -04:00
Kai Cataldo
4fc0a3839e
Fix: Allow identifier async for default param in arrow expression ( #165 )
...
fixes #118
2016-10-12 10:46:40 +02:00
Kai Cataldo
7dd45f7465
Check for duplicate named exports in exported rest elements/properties ( #164 )
2016-10-10 10:10:16 -04:00
Kai Cataldo
76e69277d7
Check for duplicate named exports in exported destructuring assignments ( #144 )
...
* Check for duplicate named exports in exported destructuring assignments
* Refactor duplicate error reporting
* Remove unnecessary check
2016-10-04 15:06:26 +02:00
Henry Zhu
5bac6e8ad9
Temporary rollback for erroring on trailing comma with spread ( #154 )
2016-10-01 20:08:25 -04:00
Daniel Tschinder
7877829fcb
Add static errors for object rest ( #149 )
...
* Fix parsing object rest
This makes object-rest-spread behave according to spec and only
allow one rest operator and enforces it to be the last
param in the object.
Also move all object-rest-spread tests to a own folder.
* Show nicer error messages
2016-09-30 11:37:55 -04:00
jezell
9cc0981c51
get / set are valid property names in default assignment ( #142 )
2016-09-27 23:29:16 +02:00
Henry Zhu
1d04d12794
Don't do the duplicate check if not an identifier ( #140 )
2016-09-23 00:44:13 -04:00
Daniel Tschinder
952d50faf9
Make exportIdentifiers and array so that base object properties are not accounted ( #137 )
2016-09-22 16:00:39 -04:00
Moti Zilberman
774e6b446b
Rephrase "assigning/binding to rvalue" errors to include context ( #119 ) ( #123 )
...
* Rephrase "assigning/binding to rvalue" error messages with context (#119 )
* Fix code style in parser/lval.js
* istanbul ignore some unused branches in parser/lval.js
* Fix code style again in parser/lval.js
2016-09-22 12:02:20 -04:00
Kai Cataldo
650e33376a
Disallow duplicate named exports ( #107 )
...
fixes #69
2016-09-22 10:20:47 -04:00
Moti Zilberman
4e1fbd48d5
Add support for computed class property names ( #120 ) ( #121 )
2016-09-21 21:24:59 -04:00
Daniel Tschinder
9cb73d8e96
fix call to this.parseMaybeAssign with correct arguments ( #133 )
2016-09-20 09:42:14 -04:00
Timothy Gu
643d3f37a4
Implement ES2016 check for simple parameter list in strict mode ( #106 )
...
* 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.
2016-09-15 19:58:01 +02:00
Dan Harper
dc3036627b
Fix Flow return types on arrow functions ( #124 )
...
* fix: arrow return type on next line is valid
https://github.com/babel/babel-eslint/issues/348
* fix: arrow on line after return type annotation is invalid
* lint
2016-09-15 19:27:11 +02:00
Daniel Tschinder
db0705bc51
Fix issues with flow-types and async function ( #95 )
...
the typeAnnotation was not correctly resolved in async
functions
2016-08-23 17:22:01 -04:00
Daniel Tschinder
2cfae60b15
Fix issues with default object params in async functions ( #96 )
...
This change allows async functions to have a spread argument which
defines a default value.
2016-08-23 17:19:49 -04:00
Daniel Tschinder
4506822180
Remove exponentiationOperator, asyncFunctions, trailingFunctionCommas ( #98 )
...
* This removes the exponentiationOperator as it is now in es2016
* Remove from tests
* Remove asyncFunctions and restructure test dirs
* Remove trailingFunctionCommas
2016-08-23 17:11:01 -04:00