Skip to content

Commit 11f58ea

Browse files
committed
Minor fixes after merging from master
1 parent cf72ceb commit 11f58ea

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

src/compiler/checker.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10138,7 +10138,7 @@ namespace ts {
1013810138
}
1013910139
let type: FlowType;
1014010140
if (flow.flags & FlowFlags.AfterFinally) {
10141-
// block flow edge: finally -> pre-try (for larger explanation check comment in binder.ts - bindTryStatement
10141+
// block flow edge: finally -> pre-try (for larger explanation check comment in binder.ts - bindTryStatement
1014210142
(<AfterFinallyFlow>flow).locked = true;
1014310143
type = getTypeAtFlowNode((<AfterFinallyFlow>flow).antecedent);
1014410144
(<AfterFinallyFlow>flow).locked = false;
@@ -10306,7 +10306,7 @@ namespace ts {
1030610306
let seenIncomplete = false;
1030710307
for (const antecedent of flow.antecedents) {
1030810308
if (antecedent.flags & FlowFlags.PreFinally && (<PreFinallyFlow>antecedent).lock.locked) {
10309-
// if flow correspond to branch from pre-try to finally and this branch is locked - this means that
10309+
// if flow correspond to branch from pre-try to finally and this branch is locked - this means that
1031010310
// we initially have started following the flow outside the finally block.
1031110311
// in this case we should ignore this branch.
1031210312
continue;
@@ -12631,7 +12631,7 @@ namespace ts {
1263112631
// If the elemType is a stringLiteral type, we can then provide a check to make sure that the string literal type is one of the Jsx intrinsic element type
1263212632
// For example:
1263312633
// var CustomTag: "h1" = "h1";
12634-
// <CustomTag> Hello World </CustomTag>
12634+
// <CustomTag> Hello World </CustomTag>
1263512635
const intrinsicElementsType = getJsxType(JsxNames.IntrinsicElements);
1263612636
if (intrinsicElementsType !== unknownType) {
1263712637
const stringLiteralTypeName = (<LiteralType>elementType).text;
@@ -12777,7 +12777,7 @@ namespace ts {
1277712777
}
1277812778

1277912779
/**
12780-
* Get the attributes type, which indicates the attributes that are valid on the given JSXOpeningLikeElement.
12780+
* Get the attributes type, which indicates the attributes that are valid on the given JSXOpeningLikeElement.
1278112781
* @param node a JSXOpeningLikeElement node
1278212782
* @return an attributes type of the given node
1278312783
*/
@@ -13590,7 +13590,7 @@ namespace ts {
1359013590
*/
1359113591
function checkApplicableSignatureForJsxOpeningLikeElement(node: JsxOpeningLikeElement, signature: Signature, relation: Map<RelationComparisonResult>) {
1359213592
// JSX opening-like element has correct arity for stateless-function component if the one of the following condition is true:
13593-
// 1. callIsIncomplete
13593+
// 1. callIsIncomplete
1359413594
// 2. attributes property has same number of properties as the parameter object type.
1359513595
// We can figure that out by resolving attributes property and check number of properties in the resolved type
1359613596
// If the call has correct arity, we will then check if the argument type and parameter type is assignable
@@ -14874,7 +14874,7 @@ namespace ts {
1487414874
error(func, Diagnostics.An_async_function_or_method_must_return_a_Promise_Make_sure_you_have_a_declaration_for_Promise_or_include_ES2015_in_your_lib_option);
1487514875
return unknownType;
1487614876
}
14877-
else if (!getGlobalPromiseConstructorSymbol()) {
14877+
else if (!getGlobalPromiseConstructorSymbol(/*reportErrors*/ true)) {
1487814878
error(func, Diagnostics.An_async_function_or_method_in_ES5_SlashES3_requires_the_Promise_constructor_Make_sure_you_have_a_declaration_for_the_Promise_constructor_or_include_ES2015_in_your_lib_option);
1487914879
}
1488014880

@@ -17525,7 +17525,7 @@ namespace ts {
1752517525
const promiseConstructorSymbol = resolveEntityName(promiseConstructorName, SymbolFlags.Value, /*ignoreErrors*/ true);
1752617526
const promiseConstructorType = promiseConstructorSymbol ? getTypeOfSymbol(promiseConstructorSymbol) : unknownType;
1752717527
if (promiseConstructorType === unknownType) {
17528-
if (promiseConstructorName.kind === SyntaxKind.Identifier && promiseConstructorName.text === "Promise" && getTargetType(returnType) === tryGetGlobalPromiseType()) {
17528+
if (promiseConstructorName.kind === SyntaxKind.Identifier && promiseConstructorName.text === "Promise" && getTargetType(returnType) === getGlobalPromiseType(/*reportErrors*/ false)) {
1752917529
error(node.type, Diagnostics.An_async_function_or_method_in_ES5_SlashES3_requires_the_Promise_constructor_Make_sure_you_have_a_declaration_for_the_Promise_constructor_or_include_ES2015_in_your_lib_option);
1753017530
}
1753117531
else {

tests/baselines/reference/types.asyncGenerators.esnext.1.symbols

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,6 @@ async function * awaitedType2() {
147147
const x = await Promise.resolve(1);
148148
>x : Symbol(x, Decl(types.asyncGenerators.esnext.1.ts, 75, 9))
149149
>Promise.resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --))
150-
>Promise : Symbol(Promise, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --))
150+
>Promise : Symbol(Promise, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --))
151151
>resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --))
152152
}

0 commit comments

Comments
 (0)