typescript 5.0.0-dev.20230131 → 5.0.0-dev.20230202
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.d.ts +0 -2
- package/lib/lib.decorators.d.ts +0 -2
- package/lib/lib.decorators.legacy.d.ts +0 -2
- package/lib/lib.dom.d.ts +0 -2
- package/lib/lib.dom.iterable.d.ts +0 -2
- package/lib/lib.es2015.collection.d.ts +0 -2
- package/lib/lib.es2015.core.d.ts +0 -2
- package/lib/lib.es2015.d.ts +0 -2
- package/lib/lib.es2015.generator.d.ts +0 -2
- package/lib/lib.es2015.iterable.d.ts +0 -2
- package/lib/lib.es2015.promise.d.ts +0 -2
- package/lib/lib.es2015.proxy.d.ts +0 -2
- package/lib/lib.es2015.reflect.d.ts +0 -2
- package/lib/lib.es2015.symbol.d.ts +0 -2
- package/lib/lib.es2015.symbol.wellknown.d.ts +0 -2
- package/lib/lib.es2016.array.include.d.ts +0 -2
- package/lib/lib.es2016.d.ts +0 -2
- package/lib/lib.es2016.full.d.ts +0 -2
- package/lib/lib.es2017.d.ts +0 -2
- package/lib/lib.es2017.full.d.ts +0 -2
- package/lib/lib.es2017.intl.d.ts +0 -2
- package/lib/lib.es2017.object.d.ts +0 -2
- package/lib/lib.es2017.sharedmemory.d.ts +0 -2
- package/lib/lib.es2017.string.d.ts +0 -2
- package/lib/lib.es2017.typedarrays.d.ts +0 -2
- package/lib/lib.es2018.asyncgenerator.d.ts +0 -2
- package/lib/lib.es2018.asynciterable.d.ts +0 -2
- package/lib/lib.es2018.d.ts +0 -2
- package/lib/lib.es2018.full.d.ts +0 -2
- package/lib/lib.es2018.intl.d.ts +0 -2
- package/lib/lib.es2018.promise.d.ts +0 -2
- package/lib/lib.es2018.regexp.d.ts +0 -2
- package/lib/lib.es2019.array.d.ts +0 -2
- package/lib/lib.es2019.d.ts +0 -2
- package/lib/lib.es2019.full.d.ts +0 -2
- package/lib/lib.es2019.intl.d.ts +0 -2
- package/lib/lib.es2019.object.d.ts +0 -2
- package/lib/lib.es2019.string.d.ts +0 -2
- package/lib/lib.es2019.symbol.d.ts +0 -2
- package/lib/lib.es2020.bigint.d.ts +0 -2
- package/lib/lib.es2020.d.ts +0 -2
- package/lib/lib.es2020.date.d.ts +0 -2
- package/lib/lib.es2020.full.d.ts +0 -2
- package/lib/lib.es2020.intl.d.ts +0 -2
- package/lib/lib.es2020.number.d.ts +0 -2
- package/lib/lib.es2020.promise.d.ts +0 -2
- package/lib/lib.es2020.sharedmemory.d.ts +0 -2
- package/lib/lib.es2020.string.d.ts +0 -2
- package/lib/lib.es2020.symbol.wellknown.d.ts +0 -2
- package/lib/lib.es2021.d.ts +0 -2
- package/lib/lib.es2021.full.d.ts +0 -2
- package/lib/lib.es2021.intl.d.ts +0 -2
- package/lib/lib.es2021.promise.d.ts +0 -2
- package/lib/lib.es2021.string.d.ts +0 -2
- package/lib/lib.es2021.weakref.d.ts +0 -2
- package/lib/lib.es2022.array.d.ts +0 -2
- package/lib/lib.es2022.d.ts +0 -2
- package/lib/lib.es2022.error.d.ts +0 -2
- package/lib/lib.es2022.full.d.ts +0 -2
- package/lib/lib.es2022.intl.d.ts +0 -2
- package/lib/lib.es2022.object.d.ts +0 -2
- package/lib/lib.es2022.regexp.d.ts +0 -2
- package/lib/lib.es2022.sharedmemory.d.ts +0 -2
- package/lib/lib.es2022.string.d.ts +0 -2
- package/lib/lib.es2023.array.d.ts +0 -2
- package/lib/lib.es2023.d.ts +0 -2
- package/lib/lib.es2023.full.d.ts +0 -2
- package/lib/lib.es5.d.ts +0 -2
- package/lib/lib.es6.d.ts +0 -2
- package/lib/lib.esnext.d.ts +0 -2
- package/lib/lib.esnext.full.d.ts +0 -2
- package/lib/lib.esnext.intl.d.ts +0 -2
- package/lib/lib.scripthost.d.ts +0 -2
- package/lib/lib.webworker.d.ts +0 -2
- package/lib/lib.webworker.importscripts.d.ts +0 -2
- package/lib/lib.webworker.iterable.d.ts +0 -2
- package/lib/tsc.js +43 -23
- package/lib/tsserver.js +55 -29
- package/lib/tsserverlibrary.d.ts +16 -0
- package/lib/tsserverlibrary.js +55 -29
- package/lib/typescript.d.ts +16 -0
- package/lib/typescript.js +55 -29
- package/lib/typingsInstaller.js +5 -4
- package/package.json +1 -1
|
@@ -14,10 +14,8 @@ and limitations under the License.
|
|
|
14
14
|
***************************************************************************** */
|
|
15
15
|
|
|
16
16
|
|
|
17
|
-
|
|
18
17
|
/// <reference no-default-lib="true"/>
|
|
19
18
|
|
|
20
|
-
|
|
21
19
|
interface String {
|
|
22
20
|
/**
|
|
23
21
|
* Replace all instances of a substring in a string, using a regular expression or search string.
|
|
@@ -14,10 +14,8 @@ and limitations under the License.
|
|
|
14
14
|
***************************************************************************** */
|
|
15
15
|
|
|
16
16
|
|
|
17
|
-
|
|
18
17
|
/// <reference no-default-lib="true"/>
|
|
19
18
|
|
|
20
|
-
|
|
21
19
|
interface WeakRef<T extends object> {
|
|
22
20
|
readonly [Symbol.toStringTag]: "WeakRef";
|
|
23
21
|
|
|
@@ -14,10 +14,8 @@ and limitations under the License.
|
|
|
14
14
|
***************************************************************************** */
|
|
15
15
|
|
|
16
16
|
|
|
17
|
-
|
|
18
17
|
/// <reference no-default-lib="true"/>
|
|
19
18
|
|
|
20
|
-
|
|
21
19
|
interface Array<T> {
|
|
22
20
|
/**
|
|
23
21
|
* Returns the item located at the specified index.
|
package/lib/lib.es2022.d.ts
CHANGED
|
@@ -14,10 +14,8 @@ and limitations under the License.
|
|
|
14
14
|
***************************************************************************** */
|
|
15
15
|
|
|
16
16
|
|
|
17
|
-
|
|
18
17
|
/// <reference no-default-lib="true"/>
|
|
19
18
|
|
|
20
|
-
|
|
21
19
|
/// <reference lib="es2021" />
|
|
22
20
|
/// <reference lib="es2022.array" />
|
|
23
21
|
/// <reference lib="es2022.error" />
|
package/lib/lib.es2022.full.d.ts
CHANGED
|
@@ -14,10 +14,8 @@ and limitations under the License.
|
|
|
14
14
|
***************************************************************************** */
|
|
15
15
|
|
|
16
16
|
|
|
17
|
-
|
|
18
17
|
/// <reference no-default-lib="true"/>
|
|
19
18
|
|
|
20
|
-
|
|
21
19
|
/// <reference lib="es2022" />
|
|
22
20
|
/// <reference lib="dom" />
|
|
23
21
|
/// <reference lib="webworker.importscripts" />
|
package/lib/lib.es2022.intl.d.ts
CHANGED
|
@@ -14,10 +14,8 @@ and limitations under the License.
|
|
|
14
14
|
***************************************************************************** */
|
|
15
15
|
|
|
16
16
|
|
|
17
|
-
|
|
18
17
|
/// <reference no-default-lib="true"/>
|
|
19
18
|
|
|
20
|
-
|
|
21
19
|
interface ObjectConstructor {
|
|
22
20
|
/**
|
|
23
21
|
* Determines whether an object has a property with the specified name.
|
|
@@ -14,10 +14,8 @@ and limitations under the License.
|
|
|
14
14
|
***************************************************************************** */
|
|
15
15
|
|
|
16
16
|
|
|
17
|
-
|
|
18
17
|
/// <reference no-default-lib="true"/>
|
|
19
18
|
|
|
20
|
-
|
|
21
19
|
interface Atomics {
|
|
22
20
|
/**
|
|
23
21
|
* A non-blocking, asynchronous version of wait which is usable on the main thread.
|
|
@@ -14,10 +14,8 @@ and limitations under the License.
|
|
|
14
14
|
***************************************************************************** */
|
|
15
15
|
|
|
16
16
|
|
|
17
|
-
|
|
18
17
|
/// <reference no-default-lib="true"/>
|
|
19
18
|
|
|
20
|
-
|
|
21
19
|
interface String {
|
|
22
20
|
/**
|
|
23
21
|
* Returns a new String consisting of the single UTF-16 code unit located at the specified index.
|
|
@@ -14,10 +14,8 @@ and limitations under the License.
|
|
|
14
14
|
***************************************************************************** */
|
|
15
15
|
|
|
16
16
|
|
|
17
|
-
|
|
18
17
|
/// <reference no-default-lib="true"/>
|
|
19
18
|
|
|
20
|
-
|
|
21
19
|
interface Array<T> {
|
|
22
20
|
/**
|
|
23
21
|
* Returns the value of the last element in the array where predicate is true, and undefined
|
package/lib/lib.es2023.d.ts
CHANGED
package/lib/lib.es2023.full.d.ts
CHANGED
|
@@ -14,10 +14,8 @@ and limitations under the License.
|
|
|
14
14
|
***************************************************************************** */
|
|
15
15
|
|
|
16
16
|
|
|
17
|
-
|
|
18
17
|
/// <reference no-default-lib="true"/>
|
|
19
18
|
|
|
20
|
-
|
|
21
19
|
/// <reference lib="es2023" />
|
|
22
20
|
/// <reference lib="dom" />
|
|
23
21
|
/// <reference lib="webworker.importscripts" />
|
package/lib/lib.es5.d.ts
CHANGED
|
@@ -14,10 +14,8 @@ and limitations under the License.
|
|
|
14
14
|
***************************************************************************** */
|
|
15
15
|
|
|
16
16
|
|
|
17
|
-
|
|
18
17
|
/// <reference no-default-lib="true"/>
|
|
19
18
|
|
|
20
|
-
|
|
21
19
|
/// <reference lib="decorators" />
|
|
22
20
|
/// <reference lib="decorators.legacy" />
|
|
23
21
|
|
package/lib/lib.es6.d.ts
CHANGED
|
@@ -14,10 +14,8 @@ and limitations under the License.
|
|
|
14
14
|
***************************************************************************** */
|
|
15
15
|
|
|
16
16
|
|
|
17
|
-
|
|
18
17
|
/// <reference no-default-lib="true"/>
|
|
19
18
|
|
|
20
|
-
|
|
21
19
|
/// <reference lib="es2015" />
|
|
22
20
|
/// <reference lib="dom" />
|
|
23
21
|
/// <reference lib="dom.iterable" />
|
package/lib/lib.esnext.d.ts
CHANGED
package/lib/lib.esnext.full.d.ts
CHANGED
|
@@ -14,10 +14,8 @@ and limitations under the License.
|
|
|
14
14
|
***************************************************************************** */
|
|
15
15
|
|
|
16
16
|
|
|
17
|
-
|
|
18
17
|
/// <reference no-default-lib="true"/>
|
|
19
18
|
|
|
20
|
-
|
|
21
19
|
/// <reference lib="esnext" />
|
|
22
20
|
/// <reference lib="dom" />
|
|
23
21
|
/// <reference lib="webworker.importscripts" />
|
package/lib/lib.esnext.intl.d.ts
CHANGED
|
@@ -14,10 +14,8 @@ and limitations under the License.
|
|
|
14
14
|
***************************************************************************** */
|
|
15
15
|
|
|
16
16
|
|
|
17
|
-
|
|
18
17
|
/// <reference no-default-lib="true"/>
|
|
19
18
|
|
|
20
|
-
|
|
21
19
|
declare namespace Intl {
|
|
22
20
|
interface NumberRangeFormatPart extends NumberFormatPart {
|
|
23
21
|
source: "startRange" | "endRange" | "shared"
|
package/lib/lib.scripthost.d.ts
CHANGED
|
@@ -14,12 +14,10 @@ and limitations under the License.
|
|
|
14
14
|
***************************************************************************** */
|
|
15
15
|
|
|
16
16
|
|
|
17
|
-
|
|
18
17
|
/// <reference no-default-lib="true"/>
|
|
19
18
|
|
|
20
19
|
|
|
21
20
|
|
|
22
|
-
|
|
23
21
|
/////////////////////////////
|
|
24
22
|
/// Windows Script Host APIS
|
|
25
23
|
/////////////////////////////
|
package/lib/lib.webworker.d.ts
CHANGED
|
@@ -14,10 +14,8 @@ and limitations under the License.
|
|
|
14
14
|
***************************************************************************** */
|
|
15
15
|
|
|
16
16
|
|
|
17
|
-
|
|
18
17
|
/// <reference no-default-lib="true"/>
|
|
19
18
|
|
|
20
|
-
|
|
21
19
|
/////////////////////////////
|
|
22
20
|
/// Worker APIs
|
|
23
21
|
/////////////////////////////
|
|
@@ -14,11 +14,9 @@ and limitations under the License.
|
|
|
14
14
|
***************************************************************************** */
|
|
15
15
|
|
|
16
16
|
|
|
17
|
-
|
|
18
17
|
/// <reference no-default-lib="true"/>
|
|
19
18
|
|
|
20
19
|
|
|
21
|
-
|
|
22
20
|
/////////////////////////////
|
|
23
21
|
/// WorkerGlobalScope APIs
|
|
24
22
|
/////////////////////////////
|
|
@@ -14,10 +14,8 @@ and limitations under the License.
|
|
|
14
14
|
***************************************************************************** */
|
|
15
15
|
|
|
16
16
|
|
|
17
|
-
|
|
18
17
|
/// <reference no-default-lib="true"/>
|
|
19
18
|
|
|
20
|
-
|
|
21
19
|
/////////////////////////////
|
|
22
20
|
/// Worker Iterable APIs
|
|
23
21
|
/////////////////////////////
|
package/lib/tsc.js
CHANGED
|
@@ -23,7 +23,7 @@ var __export = (target, all) => {
|
|
|
23
23
|
|
|
24
24
|
// src/compiler/corePublic.ts
|
|
25
25
|
var versionMajorMinor = "5.0";
|
|
26
|
-
var version = `${versionMajorMinor}.0-dev.
|
|
26
|
+
var version = `${versionMajorMinor}.0-dev.20230202`;
|
|
27
27
|
|
|
28
28
|
// src/compiler/core.ts
|
|
29
29
|
var emptyArray = [];
|
|
@@ -6051,7 +6051,6 @@ var Diagnostics = {
|
|
|
6051
6051
|
Module_0_does_not_refer_to_a_value_but_is_used_as_a_value_here: diag(1339, 1 /* Error */, "Module_0_does_not_refer_to_a_value_but_is_used_as_a_value_here_1339", "Module '{0}' does not refer to a value, but is used as a value here."),
|
|
6052
6052
|
Module_0_does_not_refer_to_a_type_but_is_used_as_a_type_here_Did_you_mean_typeof_import_0: diag(1340, 1 /* Error */, "Module_0_does_not_refer_to_a_type_but_is_used_as_a_type_here_Did_you_mean_typeof_import_0_1340", "Module '{0}' does not refer to a type, but is used as a type here. Did you mean 'typeof import('{0}')'?"),
|
|
6053
6053
|
Class_constructor_may_not_be_an_accessor: diag(1341, 1 /* Error */, "Class_constructor_may_not_be_an_accessor_1341", "Class constructor may not be an accessor."),
|
|
6054
|
-
Type_arguments_cannot_be_used_here: diag(1342, 1 /* Error */, "Type_arguments_cannot_be_used_here_1342", "Type arguments cannot be used here."),
|
|
6055
6054
|
The_import_meta_meta_property_is_only_allowed_when_the_module_option_is_es2020_es2022_esnext_system_node16_or_nodenext: diag(1343, 1 /* Error */, "The_import_meta_meta_property_is_only_allowed_when_the_module_option_is_es2020_es2022_esnext_system__1343", "The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node16', or 'nodenext'."),
|
|
6056
6055
|
A_label_is_not_allowed_here: diag(1344, 1 /* Error */, "A_label_is_not_allowed_here_1344", "'A label is not allowed here."),
|
|
6057
6056
|
An_expression_of_type_void_cannot_be_tested_for_truthiness: diag(1345, 1 /* Error */, "An_expression_of_type_void_cannot_be_tested_for_truthiness_1345", "An expression of type 'void' cannot be tested for truthiness."),
|
|
@@ -6697,7 +6696,7 @@ var Diagnostics = {
|
|
|
6697
6696
|
Private_accessor_was_defined_without_a_getter: diag(2806, 1 /* Error */, "Private_accessor_was_defined_without_a_getter_2806", "Private accessor was defined without a getter."),
|
|
6698
6697
|
This_syntax_requires_an_imported_helper_named_1_with_2_parameters_which_is_not_compatible_with_the_one_in_0_Consider_upgrading_your_version_of_0: diag(2807, 1 /* Error */, "This_syntax_requires_an_imported_helper_named_1_with_2_parameters_which_is_not_compatible_with_the_o_2807", "This syntax requires an imported helper named '{1}' with {2} parameters, which is not compatible with the one in '{0}'. Consider upgrading your version of '{0}'."),
|
|
6699
6698
|
A_get_accessor_must_be_at_least_as_accessible_as_the_setter: diag(2808, 1 /* Error */, "A_get_accessor_must_be_at_least_as_accessible_as_the_setter_2808", "A get accessor must be at least as accessible as the setter"),
|
|
6700
|
-
|
|
6699
|
+
Declaration_or_statement_expected_This_follows_a_block_of_statements_so_if_you_intended_to_write_a_destructuring_assignment_you_might_need_to_wrap_the_whole_assignment_in_parentheses: diag(2809, 1 /* Error */, "Declaration_or_statement_expected_This_follows_a_block_of_statements_so_if_you_intended_to_write_a_d_2809", "Declaration or statement expected. This '=' follows a block of statements, so if you intended to write a destructuring assignment, you might need to wrap the whole assignment in parentheses."),
|
|
6701
6700
|
Expected_1_argument_but_got_0_new_Promise_needs_a_JSDoc_hint_to_produce_a_resolve_that_can_be_called_without_arguments: diag(2810, 1 /* Error */, "Expected_1_argument_but_got_0_new_Promise_needs_a_JSDoc_hint_to_produce_a_resolve_that_can_be_called_2810", "Expected 1 argument, but got 0. 'new Promise()' needs a JSDoc hint to produce a 'resolve' that can be called without arguments."),
|
|
6702
6701
|
Initializer_for_property_0: diag(2811, 1 /* Error */, "Initializer_for_property_0_2811", "Initializer for property '{0}'"),
|
|
6703
6702
|
Property_0_does_not_exist_on_type_1_Try_changing_the_lib_compiler_option_to_include_dom: diag(2812, 1 /* Error */, "Property_0_does_not_exist_on_type_1_Try_changing_the_lib_compiler_option_to_include_dom_2812", "Property '{0}' does not exist on type '{1}'. Try changing the 'lib' compiler option to include 'dom'."),
|
|
@@ -7435,6 +7434,7 @@ var Diagnostics = {
|
|
|
7435
7434
|
new_expression_whose_target_lacks_a_construct_signature_implicitly_has_an_any_type: diag(7009, 1 /* Error */, "new_expression_whose_target_lacks_a_construct_signature_implicitly_has_an_any_type_7009", "'new' expression, whose target lacks a construct signature, implicitly has an 'any' type."),
|
|
7436
7435
|
_0_which_lacks_return_type_annotation_implicitly_has_an_1_return_type: diag(7010, 1 /* Error */, "_0_which_lacks_return_type_annotation_implicitly_has_an_1_return_type_7010", "'{0}', which lacks return-type annotation, implicitly has an '{1}' return type."),
|
|
7437
7436
|
Function_expression_which_lacks_return_type_annotation_implicitly_has_an_0_return_type: diag(7011, 1 /* Error */, "Function_expression_which_lacks_return_type_annotation_implicitly_has_an_0_return_type_7011", "Function expression, which lacks return-type annotation, implicitly has an '{0}' return type."),
|
|
7437
|
+
This_overload_implicitly_returns_the_type_0_because_it_lacks_a_return_type_annotation: diag(7012, 1 /* Error */, "This_overload_implicitly_returns_the_type_0_because_it_lacks_a_return_type_annotation_7012", "This overload implicitly returns the type '{0}' because it lacks a return type annotation."),
|
|
7438
7438
|
Construct_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type: diag(7013, 1 /* Error */, "Construct_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type_7013", "Construct signature, which lacks return-type annotation, implicitly has an 'any' return type."),
|
|
7439
7439
|
Function_type_which_lacks_return_type_annotation_implicitly_has_an_0_return_type: diag(7014, 1 /* Error */, "Function_type_which_lacks_return_type_annotation_implicitly_has_an_0_return_type_7014", "Function type, which lacks return-type annotation, implicitly has an '{0}' return type."),
|
|
7440
7440
|
Element_implicitly_has_an_any_type_because_index_expression_is_not_of_type_number: diag(7015, 1 /* Error */, "Element_implicitly_has_an_any_type_because_index_expression_is_not_of_type_number_7015", "Element implicitly has an 'any' type because index expression is not of type 'number'."),
|
|
@@ -10711,6 +10711,9 @@ function isFunctionLikeOrClassStaticBlockDeclaration(node) {
|
|
|
10711
10711
|
function isFunctionLikeDeclaration(node) {
|
|
10712
10712
|
return node && isFunctionLikeDeclarationKind(node.kind);
|
|
10713
10713
|
}
|
|
10714
|
+
function isBooleanLiteral(node) {
|
|
10715
|
+
return node.kind === 110 /* TrueKeyword */ || node.kind === 95 /* FalseKeyword */;
|
|
10716
|
+
}
|
|
10714
10717
|
function isFunctionLikeDeclarationKind(kind) {
|
|
10715
10718
|
switch (kind) {
|
|
10716
10719
|
case 259 /* FunctionDeclaration */:
|
|
@@ -16499,7 +16502,7 @@ function rangeOfNode(node) {
|
|
|
16499
16502
|
}
|
|
16500
16503
|
function rangeOfTypeParameters(sourceFile, typeParameters) {
|
|
16501
16504
|
const pos = typeParameters.pos - 1;
|
|
16502
|
-
const end = skipTrivia(sourceFile.text, typeParameters.end) + 1;
|
|
16505
|
+
const end = Math.min(sourceFile.text.length, skipTrivia(sourceFile.text, typeParameters.end) + 1);
|
|
16503
16506
|
return { pos, end };
|
|
16504
16507
|
}
|
|
16505
16508
|
function skipTypeChecking(sourceFile, options, host) {
|
|
@@ -28567,6 +28570,7 @@ var Parser;
|
|
|
28567
28570
|
switch (fourth) {
|
|
28568
28571
|
case 63 /* EqualsToken */:
|
|
28569
28572
|
case 31 /* GreaterThanToken */:
|
|
28573
|
+
case 43 /* SlashToken */:
|
|
28570
28574
|
return false;
|
|
28571
28575
|
default:
|
|
28572
28576
|
return true;
|
|
@@ -29621,7 +29625,7 @@ var Parser;
|
|
|
29621
29625
|
parseExpectedMatchingBrackets(18 /* OpenBraceToken */, 19 /* CloseBraceToken */, openBraceParsed, openBracePosition);
|
|
29622
29626
|
const result = withJSDoc(finishNode(factory2.createBlock(statements, multiLine), pos), hasJSDoc);
|
|
29623
29627
|
if (token() === 63 /* EqualsToken */) {
|
|
29624
|
-
parseErrorAtCurrentToken(Diagnostics.
|
|
29628
|
+
parseErrorAtCurrentToken(Diagnostics.Declaration_or_statement_expected_This_follows_a_block_of_statements_so_if_you_intended_to_write_a_destructuring_assignment_you_might_need_to_wrap_the_whole_assignment_in_parentheses);
|
|
29625
29629
|
nextToken();
|
|
29626
29630
|
}
|
|
29627
29631
|
return result;
|
|
@@ -41831,8 +41835,10 @@ function tryGetModuleNameAsNodeModule({ path, isRedirect }, { getCanonicalFileNa
|
|
|
41831
41835
|
const packageJsonContent = (cachedPackageJson == null ? void 0 : cachedPackageJson.contents.packageJsonContent) || JSON.parse(host.readFile(packageJsonPath));
|
|
41832
41836
|
const importMode = overrideMode || importingSourceFile.impliedNodeFormat;
|
|
41833
41837
|
if (getResolvePackageJsonExports(options)) {
|
|
41838
|
+
const nodeModulesDirectoryName2 = packageRootPath.substring(parts.topLevelPackageNameIndex + 1);
|
|
41839
|
+
const packageName2 = getPackageNameFromTypesPackageName(nodeModulesDirectoryName2);
|
|
41834
41840
|
const conditions = getConditions(options, importMode === 99 /* ESNext */);
|
|
41835
|
-
const fromExports = packageJsonContent.exports
|
|
41841
|
+
const fromExports = packageJsonContent.exports ? tryGetModuleNameFromExports(options, path, packageRootPath, packageName2, packageJsonContent.exports, conditions) : void 0;
|
|
41836
41842
|
if (fromExports) {
|
|
41837
41843
|
const withJsExtension = !hasTSFileExtension(fromExports.moduleFileToTry) ? fromExports : { moduleFileToTry: removeFileExtension(fromExports.moduleFileToTry) + tryGetJSExtensionForFile(fromExports.moduleFileToTry, options) };
|
|
41838
41844
|
return { ...withJsExtension, verbatimFromExports: true };
|
|
@@ -53593,6 +53599,12 @@ function createTypeChecker(host) {
|
|
|
53593
53599
|
thisParameter = getAnnotatedAccessorThisParameter(other);
|
|
53594
53600
|
}
|
|
53595
53601
|
}
|
|
53602
|
+
if (isInJSFile(declaration)) {
|
|
53603
|
+
const thisTag = getJSDocThisTag(declaration);
|
|
53604
|
+
if (thisTag && thisTag.typeExpression) {
|
|
53605
|
+
thisParameter = createSymbolWithType(createSymbol(1 /* FunctionScopedVariable */, "this" /* This */), getTypeFromTypeNode(thisTag.typeExpression));
|
|
53606
|
+
}
|
|
53607
|
+
}
|
|
53596
53608
|
const classType = declaration.kind === 173 /* Constructor */ ? getDeclaredTypeOfClassOrInterface(getMergedSymbol(declaration.parent.symbol)) : void 0;
|
|
53597
53609
|
const typeParameters = classType ? classType.localTypeParameters : getTypeParametersFromDeclaration(declaration);
|
|
53598
53610
|
if (hasRestParameter(declaration) || isInJSFile(declaration) && maybeAddJsSyntheticRestParameter(declaration, parameters)) {
|
|
@@ -53706,7 +53718,11 @@ function createTypeChecker(host) {
|
|
|
53706
53718
|
if (node.tags) {
|
|
53707
53719
|
for (const tag of node.tags) {
|
|
53708
53720
|
if (isJSDocOverloadTag(tag)) {
|
|
53709
|
-
|
|
53721
|
+
const jsDocSignature = tag.typeExpression;
|
|
53722
|
+
if (jsDocSignature.type === void 0) {
|
|
53723
|
+
reportImplicitAny(jsDocSignature, anyType);
|
|
53724
|
+
}
|
|
53725
|
+
result.push(getSignatureFromDeclaration(jsDocSignature));
|
|
53710
53726
|
hasJSDocOverloads = true;
|
|
53711
53727
|
}
|
|
53712
53728
|
}
|
|
@@ -55405,7 +55421,7 @@ function createTypeChecker(host) {
|
|
|
55405
55421
|
function typePredicateKindsMatch(a, b) {
|
|
55406
55422
|
return a.kind === b.kind && a.parameterIndex === b.parameterIndex;
|
|
55407
55423
|
}
|
|
55408
|
-
function getUnionTypeFromSortedList(types,
|
|
55424
|
+
function getUnionTypeFromSortedList(types, precomputedObjectFlags, aliasSymbol, aliasTypeArguments, origin) {
|
|
55409
55425
|
if (types.length === 0) {
|
|
55410
55426
|
return neverType;
|
|
55411
55427
|
}
|
|
@@ -55417,7 +55433,7 @@ function createTypeChecker(host) {
|
|
|
55417
55433
|
let type = unionTypes.get(id);
|
|
55418
55434
|
if (!type) {
|
|
55419
55435
|
type = createType(1048576 /* Union */);
|
|
55420
|
-
type.objectFlags =
|
|
55436
|
+
type.objectFlags = precomputedObjectFlags | getPropagatingFlagsOfTypes(
|
|
55421
55437
|
types,
|
|
55422
55438
|
/*excludeKinds*/
|
|
55423
55439
|
98304 /* Nullable */
|
|
@@ -56594,11 +56610,6 @@ function createTypeChecker(host) {
|
|
|
56594
56610
|
var _a2;
|
|
56595
56611
|
const links = getNodeLinks(node);
|
|
56596
56612
|
if (!links.resolvedType) {
|
|
56597
|
-
if (node.isTypeOf && node.typeArguments) {
|
|
56598
|
-
error(node, Diagnostics.Type_arguments_cannot_be_used_here);
|
|
56599
|
-
links.resolvedSymbol = unknownSymbol;
|
|
56600
|
-
return links.resolvedType = errorType;
|
|
56601
|
-
}
|
|
56602
56613
|
if (!isLiteralImportTypeNode(node)) {
|
|
56603
56614
|
error(node.argument, Diagnostics.String_literal_expected);
|
|
56604
56615
|
links.resolvedSymbol = unknownSymbol;
|
|
@@ -56659,7 +56670,7 @@ function createTypeChecker(host) {
|
|
|
56659
56670
|
const resolvedSymbol = resolveSymbol(symbol);
|
|
56660
56671
|
links.resolvedSymbol = resolvedSymbol;
|
|
56661
56672
|
if (meaning === 111551 /* Value */) {
|
|
56662
|
-
return getTypeOfSymbol(symbol);
|
|
56673
|
+
return getInstantiationExpressionType(getTypeOfSymbol(symbol), node);
|
|
56663
56674
|
} else {
|
|
56664
56675
|
const type = tryGetDeclaredTypeOfSymbol(resolvedSymbol);
|
|
56665
56676
|
const typeParameters = type && getTypeParametersForTypeAndSymbol(type, resolvedSymbol);
|
|
@@ -58737,7 +58748,8 @@ function createTypeChecker(host) {
|
|
|
58737
58748
|
Debug.assert(!isTypeAssignableTo(generalizedSource, target2), "generalized source shouldn't be assignable");
|
|
58738
58749
|
generalizedSourceType = getTypeNameForErrorDisplay(generalizedSource);
|
|
58739
58750
|
}
|
|
58740
|
-
|
|
58751
|
+
const targetFlags = target2.flags & 8388608 /* IndexedAccess */ && !(source2.flags & 8388608 /* IndexedAccess */) ? target2.objectType.flags : target2.flags;
|
|
58752
|
+
if (targetFlags & 262144 /* TypeParameter */ && target2 !== markerSuperTypeForCheck && target2 !== markerSubTypeForCheck) {
|
|
58741
58753
|
const constraint = getBaseConstraintOfType(target2);
|
|
58742
58754
|
let needsOriginalSource;
|
|
58743
58755
|
if (constraint && (isTypeAssignableTo(generalizedSource, constraint) || (needsOriginalSource = isTypeAssignableTo(source2, constraint)))) {
|
|
@@ -61655,6 +61667,11 @@ function createTypeChecker(host) {
|
|
|
61655
61667
|
case 320 /* JSDocFunctionType */:
|
|
61656
61668
|
error(declaration, Diagnostics.Function_type_which_lacks_return_type_annotation_implicitly_has_an_0_return_type, typeAsString);
|
|
61657
61669
|
return;
|
|
61670
|
+
case 326 /* JSDocSignature */:
|
|
61671
|
+
if (noImplicitAny && isJSDocOverloadTag(declaration.parent)) {
|
|
61672
|
+
error(declaration.parent.tagName, Diagnostics.This_overload_implicitly_returns_the_type_0_because_it_lacks_a_return_type_annotation, typeAsString);
|
|
61673
|
+
}
|
|
61674
|
+
return;
|
|
61658
61675
|
case 259 /* FunctionDeclaration */:
|
|
61659
61676
|
case 171 /* MethodDeclaration */:
|
|
61660
61677
|
case 170 /* MethodSignature */:
|
|
@@ -63400,7 +63417,7 @@ function createTypeChecker(host) {
|
|
|
63400
63417
|
}
|
|
63401
63418
|
return getUnionTypeFromSortedList(
|
|
63402
63419
|
filtered,
|
|
63403
|
-
type.objectFlags,
|
|
63420
|
+
type.objectFlags & (32768 /* PrimitiveUnion */ | 16777216 /* ContainsIntersections */),
|
|
63404
63421
|
/*aliasSymbol*/
|
|
63405
63422
|
void 0,
|
|
63406
63423
|
/*aliasTypeArguments*/
|
|
@@ -64742,7 +64759,7 @@ function createTypeChecker(host) {
|
|
|
64742
64759
|
}
|
|
64743
64760
|
}
|
|
64744
64761
|
function getTypeOfSymbolAtLocation(symbol, location) {
|
|
64745
|
-
symbol = symbol
|
|
64762
|
+
symbol = getExportSymbolOfValueSymbolIfExported(symbol);
|
|
64746
64763
|
if (location.kind === 79 /* Identifier */ || location.kind === 80 /* PrivateIdentifier */) {
|
|
64747
64764
|
if (isRightSideOfQualifiedNameOrPropertyAccess(location)) {
|
|
64748
64765
|
location = location.parent;
|
|
@@ -70382,6 +70399,9 @@ function createTypeChecker(host) {
|
|
|
70382
70399
|
checkGrammarExpressionWithTypeArguments(node);
|
|
70383
70400
|
forEach(node.typeArguments, checkSourceElement);
|
|
70384
70401
|
const exprType = node.kind === 230 /* ExpressionWithTypeArguments */ ? checkExpression(node.expression) : isThisIdentifier(node.exprName) ? checkThisExpression(node.exprName) : checkExpression(node.exprName);
|
|
70402
|
+
return getInstantiationExpressionType(exprType, node);
|
|
70403
|
+
}
|
|
70404
|
+
function getInstantiationExpressionType(exprType, node) {
|
|
70385
70405
|
const typeArguments = node.typeArguments;
|
|
70386
70406
|
if (exprType === silentNeverType || isErrorType(exprType) || !some(typeArguments)) {
|
|
70387
70407
|
return exprType;
|
|
@@ -73020,7 +73040,7 @@ function createTypeChecker(host) {
|
|
|
73020
73040
|
return isCallChain(expr) ? getReturnTypeOfSingleNonGenericSignatureOfCallChain(expr) : getReturnTypeOfSingleNonGenericCallSignature(checkNonNullExpression(expr.expression));
|
|
73021
73041
|
} else if (isAssertionExpression(expr) && !isConstTypeReference(expr.type)) {
|
|
73022
73042
|
return getTypeFromTypeNode(expr.type);
|
|
73023
|
-
} else if (node
|
|
73043
|
+
} else if (isLiteralExpression(node) || isBooleanLiteral(node)) {
|
|
73024
73044
|
return checkExpression(node);
|
|
73025
73045
|
}
|
|
73026
73046
|
return void 0;
|
|
@@ -78933,7 +78953,7 @@ function createTypeChecker(host) {
|
|
|
78933
78953
|
}
|
|
78934
78954
|
return node.parent.kind === 180 /* TypeReference */;
|
|
78935
78955
|
}
|
|
78936
|
-
function
|
|
78956
|
+
function isInNameOfExpressionWithTypeArguments(node) {
|
|
78937
78957
|
while (node.parent.kind === 208 /* PropertyAccessExpression */) {
|
|
78938
78958
|
node = node.parent;
|
|
78939
78959
|
}
|
|
@@ -79043,10 +79063,10 @@ function createTypeChecker(host) {
|
|
|
79043
79063
|
while (isRightSideOfQualifiedNameOrPropertyAccessOrJSDocMemberName(name)) {
|
|
79044
79064
|
name = name.parent;
|
|
79045
79065
|
}
|
|
79046
|
-
if (
|
|
79066
|
+
if (isInNameOfExpressionWithTypeArguments(name)) {
|
|
79047
79067
|
let meaning = 0 /* None */;
|
|
79048
79068
|
if (name.parent.kind === 230 /* ExpressionWithTypeArguments */) {
|
|
79049
|
-
meaning = 788968 /* Type */;
|
|
79069
|
+
meaning = isPartOfTypeNode(name) ? 788968 /* Type */ : 111551 /* Value */;
|
|
79050
79070
|
if (isExpressionWithTypeArgumentsInClassExtendsClause(name.parent)) {
|
|
79051
79071
|
meaning |= 111551 /* Value */;
|
|
79052
79072
|
}
|
|
@@ -103874,7 +103894,7 @@ function transformDeclarations(context) {
|
|
|
103874
103894
|
if (elem.kind === 229 /* OmittedExpression */) {
|
|
103875
103895
|
return elem;
|
|
103876
103896
|
}
|
|
103877
|
-
if (elem.propertyName && isIdentifier(elem.propertyName) && isIdentifier(elem.name) && !elem.symbol.isReferenced) {
|
|
103897
|
+
if (elem.propertyName && isIdentifier(elem.propertyName) && isIdentifier(elem.name) && !elem.symbol.isReferenced && !isIdentifierANonContextualKeyword(elem.propertyName)) {
|
|
103878
103898
|
return factory2.updateBindingElement(
|
|
103879
103899
|
elem,
|
|
103880
103900
|
elem.dotDotDotToken,
|