Skip to content

Commit dc1c730

Browse files
author
Joseph Watts
committed
Address code review comments
Signed-off-by: Joseph Watts <[email protected]>
1 parent fe23bba commit dc1c730

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

src/compiler/binder.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3301,9 +3301,7 @@ namespace ts {
33013301
let transformFlags = subtreeFlags | TransformFlags.AssertESNext;
33023302

33033303
// Decorators, TypeScript-specific modifiers, and type annotations are TypeScript syntax.
3304-
if (node.decorators
3305-
|| hasModifier(node, ModifierFlags.TypeScriptModifier)
3306-
|| node.type) {
3304+
if (some(node.decorators) || hasModifier(node, ModifierFlags.TypeScriptModifier) || node.type) {
33073305
transformFlags |= TransformFlags.AssertTypeScript;
33083306
}
33093307

src/compiler/transformers/ts.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -327,6 +327,8 @@ namespace ts {
327327
return undefined;
328328

329329
case SyntaxKind.PropertyDeclaration:
330+
// Property declarations are not TypeScript syntax, but they must be visited
331+
// for the decorator transformation.
330332
return visitPropertyDeclaration(node as PropertyDeclaration);
331333
case SyntaxKind.IndexSignature:
332334
case SyntaxKind.GetAccessor:
@@ -894,7 +896,6 @@ namespace ts {
894896
* Transforms the members of a class.
895897
*
896898
* @param node The current class.
897-
* @param isDerivedClass A value indicating whether the class has an extends clause that does not extend 'null'.
898899
*/
899900
function transformClassMembers(node: ClassDeclaration | ClassExpression) {
900901
const members: ClassElement[] = [];

src/compiler/transformers/utilities.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -254,6 +254,8 @@ namespace ts {
254254
* Adds super call and preceding prologue directives into the list of statements.
255255
*
256256
* @param ctor The constructor node.
257+
* @param result The list of statements.
258+
* @param visitor The visitor to apply to each node added to the result array.
257259
* @returns index of the statement that follows super call
258260
*/
259261
export function addPrologueDirectivesAndInitialSuperCall(ctor: ConstructorDeclaration, result: Statement[], visitor: Visitor): number {

0 commit comments

Comments
 (0)