@@ -230,10 +230,6 @@ namespace ts {
230
230
// ES6 export and default modifiers are elided when inside a namespace.
231
231
return currentNamespace ? undefined : node ;
232
232
233
- // Typescript ES2017 async/await are handled by ES2017 transformer
234
- case SyntaxKind . AsyncKeyword :
235
- return node ;
236
-
237
233
case SyntaxKind . PublicKeyword :
238
234
case SyntaxKind . PrivateKeyword :
239
235
case SyntaxKind . ProtectedKeyword :
@@ -297,7 +293,6 @@ namespace ts {
297
293
// - property declarations
298
294
// - index signatures
299
295
// - method overload signatures
300
- // - async methods
301
296
return visitClassDeclaration ( < ClassDeclaration > node ) ;
302
297
303
298
case SyntaxKind . ClassExpression :
@@ -310,7 +305,6 @@ namespace ts {
310
305
// - property declarations
311
306
// - index signatures
312
307
// - method overload signatures
313
- // - async methods
314
308
return visitClassExpression ( < ClassExpression > node ) ;
315
309
316
310
case SyntaxKind . HeritageClause :
@@ -325,7 +319,7 @@ namespace ts {
325
319
return visitExpressionWithTypeArguments ( < ExpressionWithTypeArguments > node ) ;
326
320
327
321
case SyntaxKind . MethodDeclaration :
328
- // TypeScript method declarations may be 'async', and may have decorators, modifiers
322
+ // TypeScript method declarations may have decorators, modifiers
329
323
// or type annotations.
330
324
return visitMethodDeclaration ( < MethodDeclaration > node ) ;
331
325
@@ -334,19 +328,19 @@ namespace ts {
334
328
return visitGetAccessor ( < GetAccessorDeclaration > node ) ;
335
329
336
330
case SyntaxKind . SetAccessor :
337
- // Set Accessors can have TypeScript modifiers, decorators, and type annotations.
331
+ // Set Accessors can have TypeScript modifiers and type annotations.
338
332
return visitSetAccessor ( < SetAccessorDeclaration > node ) ;
339
333
340
334
case SyntaxKind . FunctionDeclaration :
341
- // TypeScript function declarations may be 'async'
335
+ // Typescript function declarations can have modifiers, decorators, and type annotations.
342
336
return visitFunctionDeclaration ( < FunctionDeclaration > node ) ;
343
337
344
338
case SyntaxKind . FunctionExpression :
345
- // TypeScript function expressions may be 'async'
339
+ // TypeScript function expressions can have modifiers and type annotations.
346
340
return visitFunctionExpression ( < FunctionExpression > node ) ;
347
341
348
342
case SyntaxKind . ArrowFunction :
349
- // TypeScript arrow functions may be 'async'
343
+ // TypeScript arrow functions can have modifiers and type annotations.
350
344
return visitArrowFunction ( < ArrowFunction > node ) ;
351
345
352
346
case SyntaxKind . Parameter :
@@ -378,10 +372,6 @@ namespace ts {
378
372
// TypeScript enum declarations do not exist in ES6 and must be rewritten.
379
373
return visitEnumDeclaration ( < EnumDeclaration > node ) ;
380
374
381
- case SyntaxKind . AwaitExpression :
382
- // Typescript ES2017 async/await are handled by ES2017 transformer
383
- return visitAwaitExpression ( < AwaitExpression > node ) ;
384
-
385
375
case SyntaxKind . VariableStatement :
386
376
// TypeScript namespace exports for variable statements must be transformed.
387
377
return visitVariableStatement ( < VariableStatement > node ) ;
@@ -2050,7 +2040,7 @@ namespace ts {
2050
2040
*
2051
2041
* This function will be called when one of the following conditions are met:
2052
2042
* - The node is an overload
2053
- * - The node is marked as abstract, async, public, private, protected, or readonly
2043
+ * - The node is marked as abstract, public, private, protected, or readonly
2054
2044
* - The node has both a decorator and a computed property name
2055
2045
*
2056
2046
* @param node The method node.
@@ -2161,8 +2151,8 @@ namespace ts {
2161
2151
*
2162
2152
* This function will be called when one of the following conditions are met:
2163
2153
* - The node is an overload
2164
- * - The node is marked async
2165
2154
* - The node is exported from a TypeScript namespace
2155
+ * - The node has decorators
2166
2156
*
2167
2157
* @param node The function node.
2168
2158
*/
@@ -2197,7 +2187,7 @@ namespace ts {
2197
2187
* Visits a function expression node.
2198
2188
*
2199
2189
* This function will be called when one of the following conditions are met:
2200
- * - The node is marked async
2190
+ * - The node has type annotations
2201
2191
*
2202
2192
* @param node The function expression node.
2203
2193
*/
@@ -2216,10 +2206,6 @@ namespace ts {
2216
2206
/*location*/ node
2217
2207
) ;
2218
2208
2219
- // Keep modifiers in case of async functions
2220
- const funcModifiers = visitNodes ( node . modifiers , visitor , isModifier ) ;
2221
- func . modifiers = createNodeArray ( funcModifiers ) ;
2222
-
2223
2209
setOriginalNode ( func , node ) ;
2224
2210
2225
2211
return func ;
@@ -2228,7 +2214,7 @@ namespace ts {
2228
2214
/**
2229
2215
* @remarks
2230
2216
* This function will be called when one of the following conditions are met:
2231
- * - The node is marked async
2217
+ * - The node has type annotations
2232
2218
*/
2233
2219
function visitArrowFunction ( node : ArrowFunction ) {
2234
2220
const func = createArrowFunction (
@@ -2368,23 +2354,6 @@ namespace ts {
2368
2354
}
2369
2355
}
2370
2356
2371
- /**
2372
- * Visits an await expression.
2373
- *
2374
- * This function will be called any time a ES2017 await expression is encountered.
2375
- *
2376
- * @param node The await expression node.
2377
- */
2378
- function visitAwaitExpression ( node : AwaitExpression ) : Expression {
2379
- return updateNode (
2380
- createAwait (
2381
- visitNode ( node . expression , visitor , isExpression ) ,
2382
- /*location*/ node
2383
- ) ,
2384
- node
2385
- ) ;
2386
- }
2387
-
2388
2357
/**
2389
2358
* Visits a parenthesized expression that contains either a type assertion or an `as`
2390
2359
* expression.
0 commit comments