Skip to content

Commit 6ad0437

Browse files
committed
PR feedback
1 parent 147addb commit 6ad0437

File tree

4 files changed

+33
-33
lines changed

4 files changed

+33
-33
lines changed

src/compiler/binder.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1765,7 +1765,7 @@ namespace ts {
17651765
return bindPropertyOrMethodOrAccessor(<Declaration>node, SymbolFlags.EnumMember, SymbolFlags.EnumMemberExcludes);
17661766

17671767
case SyntaxKind.JsxSpreadAttribute:
1768-
emitFlags |= NodeFlags.HasJsxSpreadAttribute;
1768+
emitFlags |= NodeFlags.HasJsxSpreadAttributes;
17691769
return;
17701770

17711771
case SyntaxKind.CallSignature:

src/compiler/emitter.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2127,7 +2127,7 @@ const _super = (function (geti, seti) {
21272127
helpersEmitted = true;
21282128
}
21292129

2130-
if (compilerOptions.jsx !== JsxEmit.Preserve && !assignEmitted && (node.flags & NodeFlags.HasJsxSpreadAttribute)) {
2130+
if (compilerOptions.jsx !== JsxEmit.Preserve && !assignEmitted && (node.flags & NodeFlags.HasJsxSpreadAttributes)) {
21312131
writeLines(assignHelper);
21322132
assignEmitted = true;
21332133
}

src/compiler/factory.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1065,13 +1065,13 @@ namespace ts {
10651065

10661066
// Helpers
10671067

1068-
export function createHelperName(tslib: Identifier, name: string) {
1068+
export function createHelperName(tslib: Identifier | undefined, name: string) {
10691069
return tslib
10701070
? createPropertyAccess(tslib, name)
10711071
: createIdentifier(name);
10721072
}
10731073

1074-
export function createExtendsHelper(tslib: Identifier, name: Identifier) {
1074+
export function createExtendsHelper(tslib: Identifier | undefined, name: Identifier) {
10751075
return createCall(
10761076
createHelperName(tslib, "__extends"),
10771077
/*typeArguments*/ undefined,
@@ -1082,15 +1082,15 @@ namespace ts {
10821082
);
10831083
}
10841084

1085-
export function createAssignHelper(tslib: Identifier, attributesSegments: Expression[]) {
1085+
export function createAssignHelper(tslib: Identifier | undefined, attributesSegments: Expression[]) {
10861086
return createCall(
10871087
createHelperName(tslib, "__assign"),
10881088
/*typeArguments*/ undefined,
10891089
attributesSegments
10901090
);
10911091
}
10921092

1093-
export function createParamHelper(tslib: Identifier, expression: Expression, parameterOffset: number, location?: TextRange) {
1093+
export function createParamHelper(tslib: Identifier | undefined, expression: Expression, parameterOffset: number, location?: TextRange) {
10941094
return createCall(
10951095
createHelperName(tslib, "__param"),
10961096
/*typeArguments*/ undefined,
@@ -1102,7 +1102,7 @@ namespace ts {
11021102
);
11031103
}
11041104

1105-
export function createMetadataHelper(tslib: Identifier, metadataKey: string, metadataValue: Expression) {
1105+
export function createMetadataHelper(tslib: Identifier | undefined, metadataKey: string, metadataValue: Expression) {
11061106
return createCall(
11071107
createHelperName(tslib, "__metadata"),
11081108
/*typeArguments*/ undefined,
@@ -1113,7 +1113,7 @@ namespace ts {
11131113
);
11141114
}
11151115

1116-
export function createDecorateHelper(tslib: Identifier, decoratorExpressions: Expression[], target: Expression, memberName?: Expression, descriptor?: Expression, location?: TextRange) {
1116+
export function createDecorateHelper(tslib: Identifier | undefined, decoratorExpressions: Expression[], target: Expression, memberName?: Expression, descriptor?: Expression, location?: TextRange) {
11171117
const argumentsArray: Expression[] = [];
11181118
argumentsArray.push(createArrayLiteral(decoratorExpressions, /*location*/ undefined, /*multiLine*/ true));
11191119
argumentsArray.push(target);
@@ -1127,7 +1127,7 @@ namespace ts {
11271127
return createCall(createHelperName(tslib, "__decorate"), /*typeArguments*/ undefined, argumentsArray, location);
11281128
}
11291129

1130-
export function createAwaiterHelper(tslib: Identifier, hasLexicalArguments: boolean, promiseConstructor: EntityName | Expression, body: Block) {
1130+
export function createAwaiterHelper(tslib: Identifier | undefined, hasLexicalArguments: boolean, promiseConstructor: EntityName | Expression, body: Block) {
11311131
return createCall(
11321132
createHelperName(tslib, "__awaiter"),
11331133
/*typeArguments*/ undefined,

src/compiler/types.ts

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -388,34 +388,34 @@ namespace ts {
388388

389389
export const enum NodeFlags {
390390
None = 0,
391-
Let = 1 << 0, // Variable declaration
392-
Const = 1 << 1, // Variable declaration
393-
NestedNamespace = 1 << 2, // Namespace declaration
394-
Synthesized = 1 << 3, // Node was synthesized during transformation
395-
Namespace = 1 << 12, // Namespace declaration
396-
ExportContext = 1 << 13, // Export context (initialized by binding)
397-
ContainsThis = 1 << 14, // Interface contains references to "this"
398-
HasImplicitReturn = 1 << 15, // If function implicitly returns on one of codepaths (initialized by binding)
399-
HasExplicitReturn = 1 << 16, // If function has explicit reachable return on one of codepaths (initialized by binding)
400-
GlobalAugmentation = 1 << 17, // Set if module declaration is an augmentation for the global scope
401-
HasClassExtends = 1 << 18, // If the file has a non-ambient class with an extends clause in ES5 or lower (initialized by binding)
402-
HasDecorators = 1 << 19, // If the file has decorators (initialized by binding)
403-
HasParamDecorators = 1 << 20, // If the file has parameter decorators (initialized by binding)
404-
HasAsyncFunctions = 1 << 21, // If the file has async functions (initialized by binding)
405-
DisallowInContext = 1 << 22, // If node was parsed in a context where 'in-expressions' are not allowed
406-
YieldContext = 1 << 23, // If node was parsed in the 'yield' context created when parsing a generator
407-
DecoratorContext = 1 << 24, // If node was parsed as part of a decorator
408-
AwaitContext = 1 << 25, // If node was parsed in the 'await' context created when parsing an async function
409-
ThisNodeHasError = 1 << 26, // If the parser encountered an error when parsing the code that created this node
410-
JavaScriptFile = 1 << 27, // If node was parsed in a JavaScript
411-
ThisNodeOrAnySubNodesHasError = 1 << 28, // If this node or any of its children had an error
412-
HasAggregatedChildData = 1 << 29, // If we've computed data from children and cached it in this node
413-
HasJsxSpreadAttribute = 1 << 30,
391+
Let = 1 << 0, // Variable declaration
392+
Const = 1 << 1, // Variable declaration
393+
NestedNamespace = 1 << 2, // Namespace declaration
394+
Synthesized = 1 << 3, // Node was synthesized during transformation
395+
Namespace = 1 << 4, // Namespace declaration
396+
ExportContext = 1 << 5, // Export context (initialized by binding)
397+
ContainsThis = 1 << 6, // Interface contains references to "this"
398+
HasImplicitReturn = 1 << 7, // If function implicitly returns on one of codepaths (initialized by binding)
399+
HasExplicitReturn = 1 << 8, // If function has explicit reachable return on one of codepaths (initialized by binding)
400+
GlobalAugmentation = 1 << 9, // Set if module declaration is an augmentation for the global scope
401+
HasClassExtends = 1 << 10, // If the file has a non-ambient class with an extends clause in ES5 or lower (initialized by binding)
402+
HasDecorators = 1 << 11, // If the file has decorators (initialized by binding)
403+
HasParamDecorators = 1 << 12, // If the file has parameter decorators (initialized by binding)
404+
HasAsyncFunctions = 1 << 13, // If the file has async functions (initialized by binding)
405+
HasJsxSpreadAttributes = 1 << 14, // If the file as JSX spread attributes (initialized by binding)
406+
DisallowInContext = 1 << 15, // If node was parsed in a context where 'in-expressions' are not allowed
407+
YieldContext = 1 << 16, // If node was parsed in the 'yield' context created when parsing a generator
408+
DecoratorContext = 1 << 17, // If node was parsed as part of a decorator
409+
AwaitContext = 1 << 18, // If node was parsed in the 'await' context created when parsing an async function
410+
ThisNodeHasError = 1 << 19, // If the parser encountered an error when parsing the code that created this node
411+
JavaScriptFile = 1 << 20, // If node was parsed in a JavaScript
412+
ThisNodeOrAnySubNodesHasError = 1 << 21, // If this node or any of its children had an error
413+
HasAggregatedChildData = 1 << 22, // If we've computed data from children and cached it in this node
414414

415415
BlockScoped = Let | Const,
416416

417417
ReachabilityCheckFlags = HasImplicitReturn | HasExplicitReturn,
418-
EmitHelperFlags = HasClassExtends | HasDecorators | HasParamDecorators | HasAsyncFunctions | HasJsxSpreadAttribute,
418+
EmitHelperFlags = HasClassExtends | HasDecorators | HasParamDecorators | HasAsyncFunctions | HasJsxSpreadAttributes,
419419
ReachabilityAndEmitFlags = ReachabilityCheckFlags | EmitHelperFlags,
420420

421421
// Parsing context flags

0 commit comments

Comments
 (0)