typescript 5.4.0-dev.20231128 → 5.4.0-dev.20231130
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/lib.es2018.intl.d.ts +4 -3
- package/lib/lib.es2020.intl.d.ts +36 -16
- package/lib/lib.es2020.string.d.ts +14 -0
- package/lib/lib.es2021.intl.d.ts +2 -2
- package/lib/lib.es2022.intl.d.ts +2 -2
- package/lib/lib.es5.d.ts +15 -6
- package/lib/lib.esnext.d.ts +1 -0
- package/lib/lib.esnext.promise.d.ts +35 -0
- package/lib/tsc.js +83 -48
- package/lib/tsserver.js +135 -50
- package/lib/typescript.js +134 -50
- package/lib/typingsInstaller.js +23 -14
- package/package.json +2 -2
package/lib/lib.es2018.intl.d.ts
CHANGED
|
@@ -47,12 +47,13 @@ declare namespace Intl {
|
|
|
47
47
|
select(n: number): LDMLPluralRule;
|
|
48
48
|
}
|
|
49
49
|
|
|
50
|
-
|
|
50
|
+
interface PluralRulesConstructor {
|
|
51
51
|
new (locales?: string | string[], options?: PluralRulesOptions): PluralRules;
|
|
52
52
|
(locales?: string | string[], options?: PluralRulesOptions): PluralRules;
|
|
53
|
-
|
|
54
53
|
supportedLocalesOf(locales: string | string[], options?: { localeMatcher?: "lookup" | "best fit"; }): string[];
|
|
55
|
-
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
const PluralRules: PluralRulesConstructor;
|
|
56
57
|
|
|
57
58
|
// We can only have one definition for 'type' in TypeScript, and so you can learn where the keys come from here:
|
|
58
59
|
type ES2018NumberFormatPartType = "literal" | "nan" | "infinity" | "percent" | "integer" | "group" | "decimal" | "fraction" | "plusSign" | "minusSign" | "percentSign" | "currency" | "code" | "symbol" | "name";
|
package/lib/lib.es2020.intl.d.ts
CHANGED
|
@@ -19,9 +19,11 @@ and limitations under the License.
|
|
|
19
19
|
/// <reference lib="es2018.intl" />
|
|
20
20
|
declare namespace Intl {
|
|
21
21
|
/**
|
|
22
|
-
* [Unicode BCP 47 Locale
|
|
22
|
+
* A string that is a valid [Unicode BCP 47 Locale Identifier](https://unicode.org/reports/tr35/#Unicode_locale_identifier).
|
|
23
23
|
*
|
|
24
|
-
*
|
|
24
|
+
* For example: "fa", "es-MX", "zh-Hant-TW".
|
|
25
|
+
*
|
|
26
|
+
* See [MDN - Intl - locales argument](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl#locales_argument).
|
|
25
27
|
*/
|
|
26
28
|
type UnicodeBCP47LocaleIdentifier = string;
|
|
27
29
|
|
|
@@ -89,16 +91,9 @@ declare namespace Intl {
|
|
|
89
91
|
type RelativeTimeFormatStyle = "long" | "short" | "narrow";
|
|
90
92
|
|
|
91
93
|
/**
|
|
92
|
-
*
|
|
94
|
+
* The locale or locales to use
|
|
93
95
|
*
|
|
94
|
-
* [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl#locales_argument).
|
|
95
|
-
*/
|
|
96
|
-
type BCP47LanguageTag = string;
|
|
97
|
-
|
|
98
|
-
/**
|
|
99
|
-
* The locale(s) to use
|
|
100
|
-
*
|
|
101
|
-
* [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl#locales_argument).
|
|
96
|
+
* See [MDN - Intl - locales argument](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl#locales_argument).
|
|
102
97
|
*/
|
|
103
98
|
type LocalesArgument = UnicodeBCP47LocaleIdentifier | Locale | readonly (UnicodeBCP47LocaleIdentifier | Locale)[] | undefined;
|
|
104
99
|
|
|
@@ -218,7 +213,7 @@ declare namespace Intl {
|
|
|
218
213
|
* [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/RelativeTimeFormat/RelativeTimeFormat).
|
|
219
214
|
*/
|
|
220
215
|
new (
|
|
221
|
-
locales?:
|
|
216
|
+
locales?: LocalesArgument,
|
|
222
217
|
options?: RelativeTimeFormatOptions,
|
|
223
218
|
): RelativeTimeFormat;
|
|
224
219
|
|
|
@@ -241,7 +236,7 @@ declare namespace Intl {
|
|
|
241
236
|
* [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/RelativeTimeFormat/supportedLocalesOf).
|
|
242
237
|
*/
|
|
243
238
|
supportedLocalesOf(
|
|
244
|
-
locales?:
|
|
239
|
+
locales?: LocalesArgument,
|
|
245
240
|
options?: RelativeTimeFormatOptions,
|
|
246
241
|
): UnicodeBCP47LocaleIdentifier[];
|
|
247
242
|
};
|
|
@@ -312,7 +307,7 @@ declare namespace Intl {
|
|
|
312
307
|
/** Attempts to remove information about the locale that would be added by calling `Locale.maximize()`. */
|
|
313
308
|
minimize(): Locale;
|
|
314
309
|
/** Returns the locale's full locale identifier string. */
|
|
315
|
-
toString():
|
|
310
|
+
toString(): UnicodeBCP47LocaleIdentifier;
|
|
316
311
|
}
|
|
317
312
|
|
|
318
313
|
/**
|
|
@@ -330,7 +325,7 @@ declare namespace Intl {
|
|
|
330
325
|
* [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Locale).
|
|
331
326
|
*/
|
|
332
327
|
const Locale: {
|
|
333
|
-
new (tag:
|
|
328
|
+
new (tag: UnicodeBCP47LocaleIdentifier | Locale, options?: LocaleOptions): Locale;
|
|
334
329
|
};
|
|
335
330
|
|
|
336
331
|
type DisplayNamesFallback =
|
|
@@ -424,6 +419,31 @@ declare namespace Intl {
|
|
|
424
419
|
*
|
|
425
420
|
* [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DisplayNames/supportedLocalesOf).
|
|
426
421
|
*/
|
|
427
|
-
supportedLocalesOf(locales?: LocalesArgument, options?: { localeMatcher?: RelativeTimeFormatLocaleMatcher; }):
|
|
422
|
+
supportedLocalesOf(locales?: LocalesArgument, options?: { localeMatcher?: RelativeTimeFormatLocaleMatcher; }): UnicodeBCP47LocaleIdentifier[];
|
|
428
423
|
};
|
|
424
|
+
|
|
425
|
+
interface CollatorConstructor {
|
|
426
|
+
new (locales?: LocalesArgument, options?: CollatorOptions): Collator;
|
|
427
|
+
(locales?: LocalesArgument, options?: CollatorOptions): Collator;
|
|
428
|
+
supportedLocalesOf(locales: LocalesArgument, options?: CollatorOptions): string[];
|
|
429
|
+
}
|
|
430
|
+
|
|
431
|
+
interface DateTimeFormatConstructor {
|
|
432
|
+
new (locales?: LocalesArgument, options?: DateTimeFormatOptions): DateTimeFormat;
|
|
433
|
+
(locales?: LocalesArgument, options?: DateTimeFormatOptions): DateTimeFormat;
|
|
434
|
+
supportedLocalesOf(locales: LocalesArgument, options?: DateTimeFormatOptions): string[];
|
|
435
|
+
}
|
|
436
|
+
|
|
437
|
+
interface NumberFormatConstructor {
|
|
438
|
+
new (locales?: LocalesArgument, options?: NumberFormatOptions): NumberFormat;
|
|
439
|
+
(locales?: LocalesArgument, options?: NumberFormatOptions): NumberFormat;
|
|
440
|
+
supportedLocalesOf(locales: LocalesArgument, options?: NumberFormatOptions): string[];
|
|
441
|
+
}
|
|
442
|
+
|
|
443
|
+
interface PluralRulesConstructor {
|
|
444
|
+
new (locales?: LocalesArgument, options?: PluralRulesOptions): PluralRules;
|
|
445
|
+
(locales?: LocalesArgument, options?: PluralRulesOptions): PluralRules;
|
|
446
|
+
|
|
447
|
+
supportedLocalesOf(locales: LocalesArgument, options?: { localeMatcher?: "lookup" | "best fit"; }): string[];
|
|
448
|
+
}
|
|
429
449
|
}
|
|
@@ -25,4 +25,18 @@ interface String {
|
|
|
25
25
|
* @param regexp A variable name or string literal containing the regular expression pattern and flags.
|
|
26
26
|
*/
|
|
27
27
|
matchAll(regexp: RegExp): IterableIterator<RegExpMatchArray>;
|
|
28
|
+
|
|
29
|
+
/** Converts all alphabetic characters to lowercase, taking into account the host environment's current locale. */
|
|
30
|
+
toLocaleLowerCase(locales?: Intl.LocalesArgument): string;
|
|
31
|
+
|
|
32
|
+
/** Returns a string where all alphabetic characters have been converted to uppercase, taking into account the host environment's current locale. */
|
|
33
|
+
toLocaleUpperCase(locales?: Intl.LocalesArgument): string;
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Determines whether two strings are equivalent in the current or specified locale.
|
|
37
|
+
* @param that String to compare to target string
|
|
38
|
+
* @param locales A locale string or array of locale strings that contain one or more language or locale tags. If you include more than one locale string, list them in descending order of priority so that the first entry is the preferred locale. If you omit this parameter, the default locale of the JavaScript runtime is used. This parameter must conform to BCP 47 standards; see the Intl.Collator object for details.
|
|
39
|
+
* @param options An object that contains one or more properties that specify comparison options. see the Intl.Collator object for details.
|
|
40
|
+
*/
|
|
41
|
+
localeCompare(that: string, locales?: Intl.LocalesArgument, options?: Intl.CollatorOptions): number;
|
|
28
42
|
}
|
package/lib/lib.es2021.intl.d.ts
CHANGED
|
@@ -143,7 +143,7 @@ declare namespace Intl {
|
|
|
143
143
|
*
|
|
144
144
|
* [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/ListFormat).
|
|
145
145
|
*/
|
|
146
|
-
new (locales?:
|
|
146
|
+
new (locales?: LocalesArgument, options?: ListFormatOptions): ListFormat;
|
|
147
147
|
|
|
148
148
|
/**
|
|
149
149
|
* Returns an array containing those of the provided locales that are
|
|
@@ -161,6 +161,6 @@ declare namespace Intl {
|
|
|
161
161
|
*
|
|
162
162
|
* [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/ListFormat/supportedLocalesOf).
|
|
163
163
|
*/
|
|
164
|
-
supportedLocalesOf(locales:
|
|
164
|
+
supportedLocalesOf(locales: LocalesArgument, options?: Pick<ListFormatOptions, "localeMatcher">): UnicodeBCP47LocaleIdentifier[];
|
|
165
165
|
};
|
|
166
166
|
}
|
package/lib/lib.es2022.intl.d.ts
CHANGED
|
@@ -89,7 +89,7 @@ declare namespace Intl {
|
|
|
89
89
|
*
|
|
90
90
|
* [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Segmenter).
|
|
91
91
|
*/
|
|
92
|
-
new (locales?:
|
|
92
|
+
new (locales?: LocalesArgument, options?: SegmenterOptions): Segmenter;
|
|
93
93
|
|
|
94
94
|
/**
|
|
95
95
|
* Returns an array containing those of the provided locales that are supported without having to fall back to the runtime's default locale.
|
|
@@ -103,7 +103,7 @@ declare namespace Intl {
|
|
|
103
103
|
*
|
|
104
104
|
* [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Segmenter/supportedLocalesOf)
|
|
105
105
|
*/
|
|
106
|
-
supportedLocalesOf(locales:
|
|
106
|
+
supportedLocalesOf(locales: LocalesArgument, options?: Pick<SegmenterOptions, "localeMatcher">): UnicodeBCP47LocaleIdentifier[];
|
|
107
107
|
};
|
|
108
108
|
|
|
109
109
|
/**
|
package/lib/lib.es5.d.ts
CHANGED
|
@@ -4418,11 +4418,14 @@ declare namespace Intl {
|
|
|
4418
4418
|
compare(x: string, y: string): number;
|
|
4419
4419
|
resolvedOptions(): ResolvedCollatorOptions;
|
|
4420
4420
|
}
|
|
4421
|
-
|
|
4421
|
+
|
|
4422
|
+
interface CollatorConstructor {
|
|
4422
4423
|
new (locales?: string | string[], options?: CollatorOptions): Collator;
|
|
4423
4424
|
(locales?: string | string[], options?: CollatorOptions): Collator;
|
|
4424
4425
|
supportedLocalesOf(locales: string | string[], options?: CollatorOptions): string[];
|
|
4425
|
-
}
|
|
4426
|
+
}
|
|
4427
|
+
|
|
4428
|
+
var Collator: CollatorConstructor;
|
|
4426
4429
|
|
|
4427
4430
|
interface NumberFormatOptions {
|
|
4428
4431
|
localeMatcher?: string | undefined;
|
|
@@ -4454,12 +4457,15 @@ declare namespace Intl {
|
|
|
4454
4457
|
format(value: number): string;
|
|
4455
4458
|
resolvedOptions(): ResolvedNumberFormatOptions;
|
|
4456
4459
|
}
|
|
4457
|
-
|
|
4460
|
+
|
|
4461
|
+
interface NumberFormatConstructor {
|
|
4458
4462
|
new (locales?: string | string[], options?: NumberFormatOptions): NumberFormat;
|
|
4459
4463
|
(locales?: string | string[], options?: NumberFormatOptions): NumberFormat;
|
|
4460
4464
|
supportedLocalesOf(locales: string | string[], options?: NumberFormatOptions): string[];
|
|
4461
4465
|
readonly prototype: NumberFormat;
|
|
4462
|
-
}
|
|
4466
|
+
}
|
|
4467
|
+
|
|
4468
|
+
var NumberFormat: NumberFormatConstructor;
|
|
4463
4469
|
|
|
4464
4470
|
interface DateTimeFormatOptions {
|
|
4465
4471
|
localeMatcher?: "best fit" | "lookup" | undefined;
|
|
@@ -4498,12 +4504,15 @@ declare namespace Intl {
|
|
|
4498
4504
|
format(date?: Date | number): string;
|
|
4499
4505
|
resolvedOptions(): ResolvedDateTimeFormatOptions;
|
|
4500
4506
|
}
|
|
4501
|
-
|
|
4507
|
+
|
|
4508
|
+
interface DateTimeFormatConstructor {
|
|
4502
4509
|
new (locales?: string | string[], options?: DateTimeFormatOptions): DateTimeFormat;
|
|
4503
4510
|
(locales?: string | string[], options?: DateTimeFormatOptions): DateTimeFormat;
|
|
4504
4511
|
supportedLocalesOf(locales: string | string[], options?: DateTimeFormatOptions): string[];
|
|
4505
4512
|
readonly prototype: DateTimeFormat;
|
|
4506
|
-
}
|
|
4513
|
+
}
|
|
4514
|
+
|
|
4515
|
+
var DateTimeFormat: DateTimeFormatConstructor;
|
|
4507
4516
|
}
|
|
4508
4517
|
|
|
4509
4518
|
interface String {
|
package/lib/lib.esnext.d.ts
CHANGED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/*! *****************************************************************************
|
|
2
|
+
Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3
|
+
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
|
|
4
|
+
this file except in compliance with the License. You may obtain a copy of the
|
|
5
|
+
License at http://www.apache.org/licenses/LICENSE-2.0
|
|
6
|
+
|
|
7
|
+
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
8
|
+
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
|
|
9
|
+
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
|
|
10
|
+
MERCHANTABLITY OR NON-INFRINGEMENT.
|
|
11
|
+
|
|
12
|
+
See the Apache Version 2.0 License for specific language governing permissions
|
|
13
|
+
and limitations under the License.
|
|
14
|
+
***************************************************************************** */
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
/// <reference no-default-lib="true"/>
|
|
18
|
+
|
|
19
|
+
interface PromiseWithResolvers<T> {
|
|
20
|
+
promise: Promise<T>;
|
|
21
|
+
resolve: (value: T | PromiseLike<T>) => void;
|
|
22
|
+
reject: (reason?: any) => void;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
interface PromiseConstructor {
|
|
26
|
+
/**
|
|
27
|
+
* Creates a new Promise and returns it in an object, along with its resolve and reject functions.
|
|
28
|
+
* @returns An object with the properties `promise`, `resolve`, and `reject`.
|
|
29
|
+
*
|
|
30
|
+
* ```ts
|
|
31
|
+
* const { promise, resolve, reject } = Promise.withResolvers<T>();
|
|
32
|
+
* ```
|
|
33
|
+
*/
|
|
34
|
+
withResolvers<T>(): PromiseWithResolvers<T>;
|
|
35
|
+
}
|
package/lib/tsc.js
CHANGED
|
@@ -18,7 +18,7 @@ and limitations under the License.
|
|
|
18
18
|
|
|
19
19
|
// src/compiler/corePublic.ts
|
|
20
20
|
var versionMajorMinor = "5.4";
|
|
21
|
-
var version = `${versionMajorMinor}.0-dev.
|
|
21
|
+
var version = `${versionMajorMinor}.0-dev.20231130`;
|
|
22
22
|
|
|
23
23
|
// src/compiler/core.ts
|
|
24
24
|
var emptyArray = [];
|
|
@@ -32696,18 +32696,7 @@ var Parser;
|
|
|
32696
32696
|
}
|
|
32697
32697
|
nextTokenJSDoc();
|
|
32698
32698
|
skipWhitespace();
|
|
32699
|
-
const
|
|
32700
|
-
let name = tokenIsIdentifierOrKeyword(token()) ? parseEntityName(
|
|
32701
|
-
/*allowReservedWords*/
|
|
32702
|
-
true
|
|
32703
|
-
) : void 0;
|
|
32704
|
-
if (name) {
|
|
32705
|
-
while (token() === 81 /* PrivateIdentifier */) {
|
|
32706
|
-
reScanHashToken();
|
|
32707
|
-
nextTokenJSDoc();
|
|
32708
|
-
name = finishNode(factory2.createJSDocMemberName(name, parseIdentifier()), p2);
|
|
32709
|
-
}
|
|
32710
|
-
}
|
|
32699
|
+
const name = parseJSDocLinkName();
|
|
32711
32700
|
const text = [];
|
|
32712
32701
|
while (token() !== 20 /* CloseBraceToken */ && token() !== 4 /* NewLineTrivia */ && token() !== 1 /* EndOfFileToken */) {
|
|
32713
32702
|
text.push(scanner.getTokenText());
|
|
@@ -32716,6 +32705,26 @@ var Parser;
|
|
|
32716
32705
|
const create = linkType === "link" ? factory2.createJSDocLink : linkType === "linkcode" ? factory2.createJSDocLinkCode : factory2.createJSDocLinkPlain;
|
|
32717
32706
|
return finishNode(create(name, text.join("")), start2, scanner.getTokenEnd());
|
|
32718
32707
|
}
|
|
32708
|
+
function parseJSDocLinkName() {
|
|
32709
|
+
if (tokenIsIdentifierOrKeyword(token())) {
|
|
32710
|
+
const pos = getNodePos();
|
|
32711
|
+
let name = parseIdentifierName();
|
|
32712
|
+
while (parseOptional(25 /* DotToken */)) {
|
|
32713
|
+
name = finishNode(factory2.createQualifiedName(name, token() === 81 /* PrivateIdentifier */ ? createMissingNode(
|
|
32714
|
+
80 /* Identifier */,
|
|
32715
|
+
/*reportAtCurrentPosition*/
|
|
32716
|
+
false
|
|
32717
|
+
) : parseIdentifier()), pos);
|
|
32718
|
+
}
|
|
32719
|
+
while (token() === 81 /* PrivateIdentifier */) {
|
|
32720
|
+
reScanHashToken();
|
|
32721
|
+
nextTokenJSDoc();
|
|
32722
|
+
name = finishNode(factory2.createJSDocMemberName(name, parseIdentifier()), pos);
|
|
32723
|
+
}
|
|
32724
|
+
return name;
|
|
32725
|
+
}
|
|
32726
|
+
return void 0;
|
|
32727
|
+
}
|
|
32719
32728
|
function parseJSDocLinkPrefix() {
|
|
32720
32729
|
skipWhitespaceOrAsterisk();
|
|
32721
32730
|
if (token() === 19 /* OpenBraceToken */ && nextTokenJSDoc() === 60 /* AtToken */ && tokenIsIdentifierOrKeyword(nextTokenJSDoc())) {
|
|
@@ -33888,7 +33897,7 @@ var libEntries = [
|
|
|
33888
33897
|
["esnext.disposable", "lib.esnext.disposable.d.ts"],
|
|
33889
33898
|
["esnext.bigint", "lib.es2020.bigint.d.ts"],
|
|
33890
33899
|
["esnext.string", "lib.es2022.string.d.ts"],
|
|
33891
|
-
["esnext.promise", "lib.
|
|
33900
|
+
["esnext.promise", "lib.esnext.promise.d.ts"],
|
|
33892
33901
|
["esnext.weakref", "lib.es2021.weakref.d.ts"],
|
|
33893
33902
|
["esnext.decorators", "lib.esnext.decorators.d.ts"],
|
|
33894
33903
|
["decorators", "lib.decorators.d.ts"],
|
|
@@ -41776,7 +41785,7 @@ function createBinder() {
|
|
|
41776
41785
|
}
|
|
41777
41786
|
function bindSpecialPropertyAssignment(node) {
|
|
41778
41787
|
var _a;
|
|
41779
|
-
const parentSymbol = lookupSymbolForPropertyAccess(node.left.expression,
|
|
41788
|
+
const parentSymbol = lookupSymbolForPropertyAccess(node.left.expression, blockScopeContainer) || lookupSymbolForPropertyAccess(node.left.expression, container);
|
|
41780
41789
|
if (!isInJSFile(node) && !isFunctionSymbol(parentSymbol)) {
|
|
41781
41790
|
return;
|
|
41782
41791
|
}
|
|
@@ -41874,7 +41883,7 @@ function createBinder() {
|
|
|
41874
41883
|
return isBinaryExpression(propertyAccess.parent) ? getParentOfBinaryExpression(propertyAccess.parent).parent.kind === 312 /* SourceFile */ : propertyAccess.parent.parent.kind === 312 /* SourceFile */;
|
|
41875
41884
|
}
|
|
41876
41885
|
function bindPropertyAssignment(name, propertyAccess, isPrototypeProperty, containerIsClass) {
|
|
41877
|
-
let namespaceSymbol = lookupSymbolForPropertyAccess(name,
|
|
41886
|
+
let namespaceSymbol = lookupSymbolForPropertyAccess(name, blockScopeContainer) || lookupSymbolForPropertyAccess(name, container);
|
|
41878
41887
|
const isToplevel = isTopLevelNamespaceAssignment(propertyAccess);
|
|
41879
41888
|
namespaceSymbol = bindPotentiallyMissingNamespaces(namespaceSymbol, propertyAccess.expression, isToplevel, isPrototypeProperty, containerIsClass);
|
|
41880
41889
|
bindPotentiallyNewExpandoMemberToNamespace(propertyAccess, namespaceSymbol, isPrototypeProperty);
|
|
@@ -54462,7 +54471,12 @@ function createTypeChecker(host) {
|
|
|
54462
54471
|
for (const current of type.types) {
|
|
54463
54472
|
for (const prop of getPropertiesOfType(current)) {
|
|
54464
54473
|
if (!members.has(prop.escapedName)) {
|
|
54465
|
-
const combinedProp = getPropertyOfUnionOrIntersectionType(
|
|
54474
|
+
const combinedProp = getPropertyOfUnionOrIntersectionType(
|
|
54475
|
+
type,
|
|
54476
|
+
prop.escapedName,
|
|
54477
|
+
/*skipObjectFunctionPropertyAugment*/
|
|
54478
|
+
!!(type.flags & 2097152 /* Intersection */)
|
|
54479
|
+
);
|
|
54466
54480
|
if (combinedProp) {
|
|
54467
54481
|
members.set(prop.escapedName, combinedProp);
|
|
54468
54482
|
}
|
|
@@ -54952,13 +54966,17 @@ function createTypeChecker(host) {
|
|
|
54952
54966
|
return result;
|
|
54953
54967
|
}
|
|
54954
54968
|
function getUnionOrIntersectionProperty(type, name, skipObjectFunctionPropertyAugment) {
|
|
54955
|
-
var _a, _b;
|
|
54969
|
+
var _a, _b, _c;
|
|
54956
54970
|
let property = ((_a = type.propertyCacheWithoutObjectFunctionPropertyAugment) == null ? void 0 : _a.get(name)) || !skipObjectFunctionPropertyAugment ? (_b = type.propertyCache) == null ? void 0 : _b.get(name) : void 0;
|
|
54957
54971
|
if (!property) {
|
|
54958
54972
|
property = createUnionOrIntersectionProperty(type, name, skipObjectFunctionPropertyAugment);
|
|
54959
54973
|
if (property) {
|
|
54960
54974
|
const properties = skipObjectFunctionPropertyAugment ? type.propertyCacheWithoutObjectFunctionPropertyAugment || (type.propertyCacheWithoutObjectFunctionPropertyAugment = createSymbolTable()) : type.propertyCache || (type.propertyCache = createSymbolTable());
|
|
54961
54975
|
properties.set(name, property);
|
|
54976
|
+
if (skipObjectFunctionPropertyAugment && !((_c = type.propertyCache) == null ? void 0 : _c.get(name))) {
|
|
54977
|
+
const properties2 = type.propertyCache || (type.propertyCache = createSymbolTable());
|
|
54978
|
+
properties2.set(name, property);
|
|
54979
|
+
}
|
|
54962
54980
|
}
|
|
54963
54981
|
}
|
|
54964
54982
|
return property;
|
|
@@ -55068,7 +55086,22 @@ function createTypeChecker(host) {
|
|
|
55068
55086
|
}
|
|
55069
55087
|
return getPropertyOfObjectType(globalObjectType, name);
|
|
55070
55088
|
}
|
|
55071
|
-
if (type.flags &
|
|
55089
|
+
if (type.flags & 2097152 /* Intersection */) {
|
|
55090
|
+
const prop = getPropertyOfUnionOrIntersectionType(
|
|
55091
|
+
type,
|
|
55092
|
+
name,
|
|
55093
|
+
/*skipObjectFunctionPropertyAugment*/
|
|
55094
|
+
true
|
|
55095
|
+
);
|
|
55096
|
+
if (prop) {
|
|
55097
|
+
return prop;
|
|
55098
|
+
}
|
|
55099
|
+
if (!skipObjectFunctionPropertyAugment) {
|
|
55100
|
+
return getPropertyOfUnionOrIntersectionType(type, name, skipObjectFunctionPropertyAugment);
|
|
55101
|
+
}
|
|
55102
|
+
return void 0;
|
|
55103
|
+
}
|
|
55104
|
+
if (type.flags & 1048576 /* Union */) {
|
|
55072
55105
|
return getPropertyOfUnionOrIntersectionType(type, name, skipObjectFunctionPropertyAugment);
|
|
55073
55106
|
}
|
|
55074
55107
|
return void 0;
|
|
@@ -63921,12 +63954,12 @@ function createTypeChecker(host) {
|
|
|
63921
63954
|
return false;
|
|
63922
63955
|
}
|
|
63923
63956
|
function isValidTypeForTemplateLiteralPlaceholder(source, target) {
|
|
63924
|
-
if (source === target || target.flags & (1 /* Any */ | 4 /* String */)) {
|
|
63925
|
-
return true;
|
|
63926
|
-
}
|
|
63927
63957
|
if (target.flags & 2097152 /* Intersection */) {
|
|
63928
63958
|
return every(target.types, (t) => t === emptyTypeLiteralType || isValidTypeForTemplateLiteralPlaceholder(source, t));
|
|
63929
63959
|
}
|
|
63960
|
+
if (target.flags & 4 /* String */ || isTypeAssignableTo(source, target)) {
|
|
63961
|
+
return true;
|
|
63962
|
+
}
|
|
63930
63963
|
if (source.flags & 128 /* StringLiteral */) {
|
|
63931
63964
|
const value = source.value;
|
|
63932
63965
|
return !!(target.flags & 8 /* Number */ && isValidNumberString(
|
|
@@ -63943,7 +63976,7 @@ function createTypeChecker(host) {
|
|
|
63943
63976
|
const texts = source.texts;
|
|
63944
63977
|
return texts.length === 2 && texts[0] === "" && texts[1] === "" && isTypeAssignableTo(source.types[0], target);
|
|
63945
63978
|
}
|
|
63946
|
-
return
|
|
63979
|
+
return false;
|
|
63947
63980
|
}
|
|
63948
63981
|
function inferTypesFromTemplateLiteralType(source, target) {
|
|
63949
63982
|
return source.flags & 128 /* StringLiteral */ ? inferFromLiteralPartsToTemplateLiteral([source.value], emptyArray, target) : source.flags & 134217728 /* TemplateLiteral */ ? arraysEqual(source.texts, target.texts) ? map(source.types, getStringLikeTypeForType) : inferFromLiteralPartsToTemplateLiteral(source.texts, source.types, target) : void 0;
|
|
@@ -66901,14 +66934,15 @@ function createTypeChecker(host) {
|
|
|
66901
66934
|
if (declaration) {
|
|
66902
66935
|
if (isBindingElement(declaration) && !declaration.initializer && !declaration.dotDotDotToken && declaration.parent.elements.length >= 2) {
|
|
66903
66936
|
const parent = declaration.parent.parent;
|
|
66904
|
-
|
|
66937
|
+
const rootDeclaration = getRootDeclaration(parent);
|
|
66938
|
+
if (rootDeclaration.kind === 260 /* VariableDeclaration */ && getCombinedNodeFlagsCached(rootDeclaration) & 6 /* Constant */ || rootDeclaration.kind === 169 /* Parameter */) {
|
|
66905
66939
|
const links = getNodeLinks(parent);
|
|
66906
66940
|
if (!(links.flags & 4194304 /* InCheckIdentifier */)) {
|
|
66907
66941
|
links.flags |= 4194304 /* InCheckIdentifier */;
|
|
66908
66942
|
const parentType = getTypeForBindingElementParent(parent, 0 /* Normal */);
|
|
66909
66943
|
const parentTypeConstraint = parentType && mapType(parentType, getBaseConstraintOrType);
|
|
66910
66944
|
links.flags &= ~4194304 /* InCheckIdentifier */;
|
|
66911
|
-
if (parentTypeConstraint && parentTypeConstraint.flags & 1048576 /* Union */ && !(
|
|
66945
|
+
if (parentTypeConstraint && parentTypeConstraint.flags & 1048576 /* Union */ && !(rootDeclaration.kind === 169 /* Parameter */ && isSymbolAssigned(symbol))) {
|
|
66912
66946
|
const pattern = declaration.parent;
|
|
66913
66947
|
const narrowedType = getFlowTypeOfReference(
|
|
66914
66948
|
pattern,
|
|
@@ -71081,19 +71115,9 @@ function createTypeChecker(host) {
|
|
|
71081
71115
|
return Debug.fail();
|
|
71082
71116
|
}
|
|
71083
71117
|
}
|
|
71084
|
-
function getDiagnosticSpanForCallNode(node
|
|
71085
|
-
let start;
|
|
71086
|
-
let length2;
|
|
71118
|
+
function getDiagnosticSpanForCallNode(node) {
|
|
71087
71119
|
const sourceFile = getSourceFileOfNode(node);
|
|
71088
|
-
|
|
71089
|
-
const nameSpan = getErrorSpanForNode(sourceFile, node.expression.name);
|
|
71090
|
-
start = nameSpan.start;
|
|
71091
|
-
length2 = doNotIncludeArguments ? nameSpan.length : node.end - start;
|
|
71092
|
-
} else {
|
|
71093
|
-
const expressionSpan = getErrorSpanForNode(sourceFile, node.expression);
|
|
71094
|
-
start = expressionSpan.start;
|
|
71095
|
-
length2 = doNotIncludeArguments ? expressionSpan.length : node.end - start;
|
|
71096
|
-
}
|
|
71120
|
+
const { start, length: length2 } = getErrorSpanForNode(sourceFile, isPropertyAccessExpression(node.expression) ? node.expression.name : node.expression);
|
|
71097
71121
|
return { start, length: length2, sourceFile };
|
|
71098
71122
|
}
|
|
71099
71123
|
function getDiagnosticForCallNode(node, message, ...args) {
|
|
@@ -71110,6 +71134,18 @@ function createTypeChecker(host) {
|
|
|
71110
71134
|
return createDiagnosticForNodeFromMessageChain(getSourceFileOfNode(node), node, message);
|
|
71111
71135
|
}
|
|
71112
71136
|
}
|
|
71137
|
+
function getErrorNodeForCallNode(callLike) {
|
|
71138
|
+
if (isCallOrNewExpression(callLike)) {
|
|
71139
|
+
return isPropertyAccessExpression(callLike.expression) ? callLike.expression.name : callLike.expression;
|
|
71140
|
+
}
|
|
71141
|
+
if (isTaggedTemplateExpression(callLike)) {
|
|
71142
|
+
return isPropertyAccessExpression(callLike.tag) ? callLike.tag.name : callLike.tag;
|
|
71143
|
+
}
|
|
71144
|
+
if (isJsxOpeningLikeElement(callLike)) {
|
|
71145
|
+
return callLike.tagName;
|
|
71146
|
+
}
|
|
71147
|
+
return callLike;
|
|
71148
|
+
}
|
|
71113
71149
|
function isPromiseResolveArityError(node) {
|
|
71114
71150
|
if (!isCallExpression(node) || !isIdentifier(node.expression))
|
|
71115
71151
|
return false;
|
|
@@ -71411,7 +71447,7 @@ function createTypeChecker(host) {
|
|
|
71411
71447
|
const { file, start, length: length2 } = diags[0];
|
|
71412
71448
|
diag2 = { file, start, length: length2, code: chain.code, category: chain.category, messageText: chain, relatedInformation: related };
|
|
71413
71449
|
} else {
|
|
71414
|
-
diag2 = createDiagnosticForNodeFromMessageChain(getSourceFileOfNode(node), node, chain, related);
|
|
71450
|
+
diag2 = createDiagnosticForNodeFromMessageChain(getSourceFileOfNode(node), getErrorNodeForCallNode(node), chain, related);
|
|
71415
71451
|
}
|
|
71416
71452
|
addImplementationSuccessElaboration(candidatesForArgumentError[0], diag2);
|
|
71417
71453
|
diagnostics.add(diag2);
|
|
@@ -71939,11 +71975,7 @@ function createTypeChecker(host) {
|
|
|
71939
71975
|
addRelatedInfo(diagnostic, createDiagnosticForNode(errorTarget, relatedInfo));
|
|
71940
71976
|
}
|
|
71941
71977
|
if (isCallExpression(errorTarget.parent)) {
|
|
71942
|
-
const { start, length: length2 } = getDiagnosticSpanForCallNode(
|
|
71943
|
-
errorTarget.parent,
|
|
71944
|
-
/*doNotIncludeArguments*/
|
|
71945
|
-
true
|
|
71946
|
-
);
|
|
71978
|
+
const { start, length: length2 } = getDiagnosticSpanForCallNode(errorTarget.parent);
|
|
71947
71979
|
diagnostic.start = start;
|
|
71948
71980
|
diagnostic.length = length2;
|
|
71949
71981
|
}
|
|
@@ -75313,16 +75345,19 @@ function createTypeChecker(host) {
|
|
|
75313
75345
|
}
|
|
75314
75346
|
}
|
|
75315
75347
|
}
|
|
75316
|
-
function
|
|
75348
|
+
function getNonGenericReturnTypeOfSingleCallSignature(funcType) {
|
|
75317
75349
|
const signature = getSingleCallSignature(funcType);
|
|
75318
|
-
if (signature
|
|
75319
|
-
|
|
75350
|
+
if (signature) {
|
|
75351
|
+
const returnType = getReturnTypeOfSignature(signature);
|
|
75352
|
+
if (!signature.typeParameters || !couldContainTypeVariables(returnType)) {
|
|
75353
|
+
return returnType;
|
|
75354
|
+
}
|
|
75320
75355
|
}
|
|
75321
75356
|
}
|
|
75322
75357
|
function getReturnTypeOfSingleNonGenericSignatureOfCallChain(expr) {
|
|
75323
75358
|
const funcType = checkExpression(expr.expression);
|
|
75324
75359
|
const nonOptionalType = getOptionalExpressionType(funcType, expr.expression);
|
|
75325
|
-
const returnType =
|
|
75360
|
+
const returnType = getNonGenericReturnTypeOfSingleCallSignature(funcType);
|
|
75326
75361
|
return returnType && propagateOptionalTypeMarker(returnType, expr, nonOptionalType !== funcType);
|
|
75327
75362
|
}
|
|
75328
75363
|
function getTypeOfExpression(node) {
|
|
@@ -75367,7 +75402,7 @@ function createTypeChecker(host) {
|
|
|
75367
75402
|
/*requireStringLiteralLikeArgument*/
|
|
75368
75403
|
true
|
|
75369
75404
|
) && !isSymbolOrSymbolForCall(expr)) {
|
|
75370
|
-
return isCallChain(expr) ? getReturnTypeOfSingleNonGenericSignatureOfCallChain(expr) :
|
|
75405
|
+
return isCallChain(expr) ? getReturnTypeOfSingleNonGenericSignatureOfCallChain(expr) : getNonGenericReturnTypeOfSingleCallSignature(checkNonNullExpression(expr.expression));
|
|
75371
75406
|
} else if (isAssertionExpression(expr) && !isConstTypeReference(expr.type)) {
|
|
75372
75407
|
return getTypeFromTypeNode(expr.type);
|
|
75373
75408
|
} else if (isLiteralExpression(node) || isBooleanLiteral(node)) {
|