64 Commits

Author SHA1 Message Date
Sam Goldman
b396cdcbe5 Internal slot properties (#7947)
* Support internalSlots to babel-types and babel-generator

* Parsing support for internal slot properties

* Print internal slots in babel-generator

* Add whitespace before first internal slot property
2018-05-16 22:48:12 -05:00
Nicolò Ribaudo
e45d5c3b65 Add an option to Babylon to have decorators before export (#7869)
* Add support for plugin options in Babylon

They work similarly to how they work in Babel. e.g.
  babylon.parse({
    options: [
      "plugin1",
      ["plugin2", { option: true }]
    ]
  });

The inernal api to get an option is
  this.getPluginOption("pluginName", "option")
If the plugin isn't defined, it returns undefined.

* Add Babylon option decorators.secoratorsBeforeExport

* Nit
2018-05-15 11:39:53 -05:00
Brian Ng
02c4a28608
Fix typescript decorator test (#7904) 2018-05-10 17:31:38 -05:00
Nicolò Ribaudo
25c3f0d689
Rename decorators&decorators2 plugins to decorators-legacy&decorators. (#7821)
Reasons:
1) Naming consistency with Babel plugins
2) Sooner or later the decorators2 plugin should become decorators anyway
2018-05-10 20:01:35 +02:00
Michael Mantel
84e76e2d49 TypeScript: Allow non-null and type assertions as lvalues. (Fixes #7638) (#7888) 2018-05-09 16:45:50 -05:00
Brian Ng
d608535719
Allow parsing of decorators with TypeScript abstract classes (#7850)
* Allow parsing of decorators with TypeScript abstract classes

* avoid lookahead
2018-05-02 13:49:46 -05:00
Brian Ng
0353ce9ed5 Disallow flow type parameter defaults in some cases 2018-05-02 08:56:54 -05:00
Brian Ng
65ca968f8b Allow static? as identifier in ObjectTypeProperty 2018-05-02 08:56:54 -05:00
James DiGioia
4f312f5739 Add syntax error test for arrow w/ paren'd args 2018-04-27 23:15:21 +02:00
James DiGioia
696f84468e Add test for params w/ parens around them 2018-04-27 23:15:21 +02:00
James DiGioia
71fd37067e Avoid lookahead when parsing pipeline
The error message is worse, but it is much more performant.
2018-04-27 23:15:21 +02:00
James DiGioia
7142a79eb9 Bring pipelineOperator flag in line with minimal
The minimal proposal requires parentheses around arrow functions
and bans await from the pipeline.
2018-04-27 23:15:21 +02:00
Brian Ng
3299086955
Add support for flow implements (#7741) 2018-04-18 08:54:30 -05:00
Nicolò Ribaudo
341bdab90c Update decorators parsing (#7719)
* Update decorators parsing

This commit introduces three changes:
1) Class properties can be decorated
2) Decorators can contain arbitrary expressions, using @(...)
3) The Decorator node type has a new property, "arguments". This
    makes it possible do distinguish @dec() and @(dec()), which have
    different behaviors because @(dec()) is equivalent to @(dec())().

* Rename Decorator#expression to Decorator#callee

* Add test for @dec()()
2018-04-17 16:22:03 -05:00
Dennis Czombera
61ec5ce957 Provide better error message for invalid default export declaration (#7717) 2018-04-12 17:07:41 -05:00
Nicolò Ribaudo
a86d14de61 Disallow super() in class properties 2018-04-12 22:41:28 +02:00
Nicolò Ribaudo
a62cfe9045 Disallow arguments in class properties 2018-04-12 22:41:28 +02:00
Nicolò Ribaudo
f797454a18 Disallow super in functions in class properties 2018-04-12 22:41:28 +02:00
John-David Dalton
59ba3959dc Add options.allowAwaitOutsideFunction. (#7637) 2018-03-29 10:41:14 -04:00
Justin Ridgewell
ab7d1231ad
Fix flow errors with Logical Assignment Operators (#7629)
* Fix flow errors with logical assignment

* Fix column numbers
2018-03-25 22:47:48 +01:00
Justin Ridgewell
a7bddc02ba
Add ??= to Logical Assignment Operators (#7623)
`??=` is being merged into the Logical Assignment Operator proposal, and the overall proposal will wait until nullish coalescing is finalized.
2018-03-25 18:58:51 +01:00
Logan Smyth
21309cc8d4 Make these tests re-throw the same error to keep the trace. 2018-03-23 21:26:50 -07:00
Andy
19708e0154 TypeScript: support mapped type modifiers syntax (#7383) 2018-03-23 14:34:15 -04:00
Brian Ng
840ba187a7
Prevent duplicate regex flags (#7617) 2018-03-22 10:25:26 -05:00
Logan Smyth
3c8e9acd4a Make the unambiguous grammar select module when import.meta is used. 2018-03-09 14:44:06 -08:00
Daniel Tschinder
5d615dd198 Disallow setters to have RestElement (#7498) 2018-03-05 18:03:59 -06:00
K Sashi Kumar
d187c26748 Spec Violation: Fix var initializer in for-in loop (#7392) 2018-03-04 16:18:32 -08:00
Andy
6f3be3a543 typescript: Support definite assignment assertion (#7159) 2018-02-24 16:26:07 -06:00
Andy
6f6c8dabba TypeScript: Support conditional types syntax (#7404)
Microsoft/TypeScript#21316 and Microsoft/TypeScript#21496
2018-02-24 14:56:14 +01:00
Justin Ridgewell
7e90d56024
Proposal: Logical Assignment Operators (#7385)
* Proposal: Logical Assignment Operators

https://github.com/jridgewell/proposal-logical-assignment

I'm bringing it [back](https://github.com/babel/babel/pull/516). 😉

* Use expectPlugin

* Add to stage 0 preset

* Add logicalAssignment missing plugin log stuff
2018-02-18 13:56:29 -05:00
Naveen jain
92580e750d Fixes issues regarding super in optionalChain (#7356) 2018-02-08 14:31:47 -05:00
Naveen jain
a3ad518ce1 [BugFix] : OptionalChaining Bug fixes (#7288)
* Added optionalExpression types to babylon and babel-types

* OptionalChain transforms bug fix

* Added OptionalExpressions to babel-generator. Fixed OptionalChain Bugs

* Removed 'optionalChain' from newExpression and added test cases

* Added test cases for optionalChain

* Update index.js
2018-02-07 19:42:14 -05:00
K Sashi Kumar
ed98d2491e [Typescript] - Fix SyntaxError in async arrow functions with rest params (#7297)
* Fix: [Typescript] - SyntaxError in async arrow functions with rest params

* Fix optional params and add test code in flow
2018-01-31 21:05:24 +01:00
Naveen jain
65ae4ff15b Fix: export default decorated class parsed as class expression (#7189) 2018-01-30 12:00:29 -05:00
Brian Ng
fa5eb4f605 Make comment props more consistent (#7246) 2018-01-26 10:39:52 -05:00
Andy
dccfed3601 TypeScript: Support parsing 'unique' type operator (#7239) 2018-01-22 16:09:22 -05:00
Andy
667f5815c1 typescript: Properly set this.state.inType one token before parsing a type (#7225)
* typescript: Properly set this.state.inType one token before parsing a type

* Reuse tsParseTypeArguments and inline tsExpectLessThanThenParseInType
2018-01-17 08:36:04 -05:00
Raja Sekar
2d05487293 Add support for @@iterator (#7058) 2018-01-12 09:19:11 -06:00
Peri Nikhil
c3352ad2e0 Fix: unicode characters not allowed in regexes (#7179)
Issue #6691
2018-01-10 15:33:21 +01:00
Maaz Syed Adeeb
9e384f3915 Cleaning up some TS parsing tests (#7184) 2018-01-09 11:37:05 -06:00
Raja Sekar
0f42accb87 Renamed files 2018-01-09 15:36:42 +01:00
Maaz Syed Adeeb
74682f33bc Support 'assert and assign' TypeScript syntax (#7098) 2018-01-08 15:29:27 -06:00
Sophie Alpert
8250ff963e Suggest JSX fragment syntax in adjacent tag error (#7152) 2018-01-04 09:21:39 +01:00
Raja Sekar
e872f0d975 Regex parsing issue fix after function declaration. (#7121) 2018-01-03 14:21:18 +01:00
Raja Sekar
f3410e761c Flow comment parsing (#7007) 2017-12-30 23:53:08 +01:00
Andy
6a73f39199 Support parsing export default abstract class {} (#7075) 2017-12-21 16:13:31 +01:00
Brian Ng
2b065350b5 Treat import type * as a parser error (#7061) 2017-12-19 10:54:20 -05:00
Brian Ng
f5ef928586
Add method property to ObjectTypeProperty (#7005) 2017-12-11 09:32:16 -06:00
K Sashi Kumar
ac745ded0d Fix destructuring assignment spec violation (#6986) 2017-12-07 09:14:03 -06:00
Andy
aa38c47160 For babylon typescript parser, fix false positive for ! after a line break (#6969)
Closes #6798
2017-12-04 19:57:22 +01:00