@typescript-deploys/pr-build 5.4.0-pr-56555-7 → 5.4.0-pr-56736-6
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/tsc.js +297 -103
- package/lib/tsserver.js +300 -119
- package/lib/typescript.d.ts +14 -0
- package/lib/typescript.js +300 -120
- package/lib/typingsInstaller.js +225 -36
- package/package.json +3 -3
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-insiders.
|
|
21
|
+
var version = `${versionMajorMinor}.0-insiders.20231211`;
|
|
22
22
|
|
|
23
23
|
// src/compiler/core.ts
|
|
24
24
|
var emptyArray = [];
|
|
@@ -7794,7 +7794,9 @@ var Diagnostics = {
|
|
|
7794
7794
|
Compiler_option_0_cannot_be_given_an_empty_string: diag(18051, 1 /* Error */, "Compiler_option_0_cannot_be_given_an_empty_string_18051", "Compiler option '{0}' cannot be given an empty string."),
|
|
7795
7795
|
Non_abstract_class_0_does_not_implement_all_abstract_members_of_1: diag(18052, 1 /* Error */, "Non_abstract_class_0_does_not_implement_all_abstract_members_of_1_18052", "Non-abstract class '{0}' does not implement all abstract members of '{1}'"),
|
|
7796
7796
|
Its_type_0_is_not_a_valid_JSX_element_type: diag(18053, 1 /* Error */, "Its_type_0_is_not_a_valid_JSX_element_type_18053", "Its type '{0}' is not a valid JSX element type."),
|
|
7797
|
-
await_using_statements_cannot_be_used_inside_a_class_static_block: diag(18054, 1 /* Error */, "await_using_statements_cannot_be_used_inside_a_class_static_block_18054", "'await using' statements cannot be used inside a class static block.")
|
|
7797
|
+
await_using_statements_cannot_be_used_inside_a_class_static_block: diag(18054, 1 /* Error */, "await_using_statements_cannot_be_used_inside_a_class_static_block_18054", "'await using' statements cannot be used inside a class static block."),
|
|
7798
|
+
A_member_initializer_in_a_enum_declaration_for_a_string_value_must_be_a_string_literal_when_isolatedModules_is_enabled: diag(18055, 1 /* Error */, "A_member_initializer_in_a_enum_declaration_for_a_string_value_must_be_a_string_literal_when_isolated_18055", "A member initializer in a enum declaration for a string value must be a string literal when 'isolatedModules' is enabled."),
|
|
7799
|
+
Enum_member_following_a_non_literal_numeric_member_must_have_an_initializer_when_isolatedModules_is_enabled: diag(18056, 1 /* Error */, "Enum_member_following_a_non_literal_numeric_member_must_have_an_initializer_when_isolatedModules_is__18056", "Enum member following a non-literal numeric member must have an initializer when 'isolatedModules' is enabled.")
|
|
7798
7800
|
};
|
|
7799
7801
|
|
|
7800
7802
|
// src/compiler/scanner.ts
|
|
@@ -16362,38 +16364,231 @@ function getSetExternalModuleIndicator(options) {
|
|
|
16362
16364
|
return callback;
|
|
16363
16365
|
}
|
|
16364
16366
|
}
|
|
16365
|
-
function
|
|
16366
|
-
return
|
|
16367
|
-
}
|
|
16368
|
-
function getEmitModuleKind(compilerOptions) {
|
|
16369
|
-
return typeof compilerOptions.module === "number" ? compilerOptions.module : getEmitScriptTarget(compilerOptions) >= 2 /* ES2015 */ ? 5 /* ES2015 */ : 1 /* CommonJS */;
|
|
16367
|
+
function createComputedCompilerOptions(options) {
|
|
16368
|
+
return options;
|
|
16370
16369
|
}
|
|
16370
|
+
var computedOptions = createComputedCompilerOptions({
|
|
16371
|
+
target: {
|
|
16372
|
+
dependencies: ["module"],
|
|
16373
|
+
computeValue: (compilerOptions) => {
|
|
16374
|
+
return compilerOptions.target ?? (compilerOptions.module === 100 /* Node16 */ && 9 /* ES2022 */ || compilerOptions.module === 199 /* NodeNext */ && 99 /* ESNext */ || 1 /* ES5 */);
|
|
16375
|
+
}
|
|
16376
|
+
},
|
|
16377
|
+
module: {
|
|
16378
|
+
dependencies: ["target"],
|
|
16379
|
+
computeValue: (compilerOptions) => {
|
|
16380
|
+
return typeof compilerOptions.module === "number" ? compilerOptions.module : computedOptions.target.computeValue(compilerOptions) >= 2 /* ES2015 */ ? 5 /* ES2015 */ : 1 /* CommonJS */;
|
|
16381
|
+
}
|
|
16382
|
+
},
|
|
16383
|
+
moduleResolution: {
|
|
16384
|
+
dependencies: ["module", "target"],
|
|
16385
|
+
computeValue: (compilerOptions) => {
|
|
16386
|
+
let moduleResolution = compilerOptions.moduleResolution;
|
|
16387
|
+
if (moduleResolution === void 0) {
|
|
16388
|
+
switch (computedOptions.module.computeValue(compilerOptions)) {
|
|
16389
|
+
case 1 /* CommonJS */:
|
|
16390
|
+
moduleResolution = 2 /* Node10 */;
|
|
16391
|
+
break;
|
|
16392
|
+
case 100 /* Node16 */:
|
|
16393
|
+
moduleResolution = 3 /* Node16 */;
|
|
16394
|
+
break;
|
|
16395
|
+
case 199 /* NodeNext */:
|
|
16396
|
+
moduleResolution = 99 /* NodeNext */;
|
|
16397
|
+
break;
|
|
16398
|
+
default:
|
|
16399
|
+
moduleResolution = 1 /* Classic */;
|
|
16400
|
+
break;
|
|
16401
|
+
}
|
|
16402
|
+
}
|
|
16403
|
+
return moduleResolution;
|
|
16404
|
+
}
|
|
16405
|
+
},
|
|
16406
|
+
moduleDetection: {
|
|
16407
|
+
dependencies: ["module", "target"],
|
|
16408
|
+
computeValue: (compilerOptions) => {
|
|
16409
|
+
return compilerOptions.moduleDetection || (computedOptions.module.computeValue(compilerOptions) === 100 /* Node16 */ || computedOptions.module.computeValue(compilerOptions) === 199 /* NodeNext */ ? 3 /* Force */ : 2 /* Auto */);
|
|
16410
|
+
}
|
|
16411
|
+
},
|
|
16412
|
+
isolatedModules: {
|
|
16413
|
+
dependencies: ["verbatimModuleSyntax"],
|
|
16414
|
+
computeValue: (compilerOptions) => {
|
|
16415
|
+
return !!(compilerOptions.isolatedModules || compilerOptions.verbatimModuleSyntax);
|
|
16416
|
+
}
|
|
16417
|
+
},
|
|
16418
|
+
esModuleInterop: {
|
|
16419
|
+
dependencies: ["module", "target"],
|
|
16420
|
+
computeValue: (compilerOptions) => {
|
|
16421
|
+
if (compilerOptions.esModuleInterop !== void 0) {
|
|
16422
|
+
return compilerOptions.esModuleInterop;
|
|
16423
|
+
}
|
|
16424
|
+
switch (computedOptions.module.computeValue(compilerOptions)) {
|
|
16425
|
+
case 100 /* Node16 */:
|
|
16426
|
+
case 199 /* NodeNext */:
|
|
16427
|
+
return true;
|
|
16428
|
+
}
|
|
16429
|
+
return false;
|
|
16430
|
+
}
|
|
16431
|
+
},
|
|
16432
|
+
allowSyntheticDefaultImports: {
|
|
16433
|
+
dependencies: ["module", "target", "moduleResolution"],
|
|
16434
|
+
computeValue: (compilerOptions) => {
|
|
16435
|
+
if (compilerOptions.allowSyntheticDefaultImports !== void 0) {
|
|
16436
|
+
return compilerOptions.allowSyntheticDefaultImports;
|
|
16437
|
+
}
|
|
16438
|
+
return computedOptions.esModuleInterop.computeValue(compilerOptions) || computedOptions.module.computeValue(compilerOptions) === 4 /* System */ || computedOptions.moduleResolution.computeValue(compilerOptions) === 100 /* Bundler */;
|
|
16439
|
+
}
|
|
16440
|
+
},
|
|
16441
|
+
resolvePackageJsonExports: {
|
|
16442
|
+
dependencies: ["moduleResolution"],
|
|
16443
|
+
computeValue: (compilerOptions) => {
|
|
16444
|
+
const moduleResolution = computedOptions.moduleResolution.computeValue(compilerOptions);
|
|
16445
|
+
if (!moduleResolutionSupportsPackageJsonExportsAndImports(moduleResolution)) {
|
|
16446
|
+
return false;
|
|
16447
|
+
}
|
|
16448
|
+
if (compilerOptions.resolvePackageJsonExports !== void 0) {
|
|
16449
|
+
return compilerOptions.resolvePackageJsonExports;
|
|
16450
|
+
}
|
|
16451
|
+
switch (moduleResolution) {
|
|
16452
|
+
case 3 /* Node16 */:
|
|
16453
|
+
case 99 /* NodeNext */:
|
|
16454
|
+
case 100 /* Bundler */:
|
|
16455
|
+
return true;
|
|
16456
|
+
}
|
|
16457
|
+
return false;
|
|
16458
|
+
}
|
|
16459
|
+
},
|
|
16460
|
+
resolvePackageJsonImports: {
|
|
16461
|
+
dependencies: ["moduleResolution", "resolvePackageJsonExports"],
|
|
16462
|
+
computeValue: (compilerOptions) => {
|
|
16463
|
+
const moduleResolution = computedOptions.moduleResolution.computeValue(compilerOptions);
|
|
16464
|
+
if (!moduleResolutionSupportsPackageJsonExportsAndImports(moduleResolution)) {
|
|
16465
|
+
return false;
|
|
16466
|
+
}
|
|
16467
|
+
if (compilerOptions.resolvePackageJsonExports !== void 0) {
|
|
16468
|
+
return compilerOptions.resolvePackageJsonExports;
|
|
16469
|
+
}
|
|
16470
|
+
switch (moduleResolution) {
|
|
16471
|
+
case 3 /* Node16 */:
|
|
16472
|
+
case 99 /* NodeNext */:
|
|
16473
|
+
case 100 /* Bundler */:
|
|
16474
|
+
return true;
|
|
16475
|
+
}
|
|
16476
|
+
return false;
|
|
16477
|
+
}
|
|
16478
|
+
},
|
|
16479
|
+
resolveJsonModule: {
|
|
16480
|
+
dependencies: ["moduleResolution", "module", "target"],
|
|
16481
|
+
computeValue: (compilerOptions) => {
|
|
16482
|
+
if (compilerOptions.resolveJsonModule !== void 0) {
|
|
16483
|
+
return compilerOptions.resolveJsonModule;
|
|
16484
|
+
}
|
|
16485
|
+
return computedOptions.moduleResolution.computeValue(compilerOptions) === 100 /* Bundler */;
|
|
16486
|
+
}
|
|
16487
|
+
},
|
|
16488
|
+
declaration: {
|
|
16489
|
+
dependencies: ["composite"],
|
|
16490
|
+
computeValue: (compilerOptions) => {
|
|
16491
|
+
return !!(compilerOptions.declaration || compilerOptions.composite);
|
|
16492
|
+
}
|
|
16493
|
+
},
|
|
16494
|
+
preserveConstEnums: {
|
|
16495
|
+
dependencies: ["isolatedModules", "verbatimModuleSyntax"],
|
|
16496
|
+
computeValue: (compilerOptions) => {
|
|
16497
|
+
return !!(compilerOptions.preserveConstEnums || computedOptions.isolatedModules.computeValue(compilerOptions));
|
|
16498
|
+
}
|
|
16499
|
+
},
|
|
16500
|
+
incremental: {
|
|
16501
|
+
dependencies: ["composite"],
|
|
16502
|
+
computeValue: (compilerOptions) => {
|
|
16503
|
+
return !!(compilerOptions.incremental || compilerOptions.composite);
|
|
16504
|
+
}
|
|
16505
|
+
},
|
|
16506
|
+
declarationMap: {
|
|
16507
|
+
dependencies: ["declaration", "composite"],
|
|
16508
|
+
computeValue: (compilerOptions) => {
|
|
16509
|
+
return !!(compilerOptions.declarationMap && computedOptions.declaration.computeValue(compilerOptions));
|
|
16510
|
+
}
|
|
16511
|
+
},
|
|
16512
|
+
allowJs: {
|
|
16513
|
+
dependencies: ["checkJs"],
|
|
16514
|
+
computeValue: (compilerOptions) => {
|
|
16515
|
+
return compilerOptions.allowJs === void 0 ? !!compilerOptions.checkJs : compilerOptions.allowJs;
|
|
16516
|
+
}
|
|
16517
|
+
},
|
|
16518
|
+
useDefineForClassFields: {
|
|
16519
|
+
dependencies: ["target", "module"],
|
|
16520
|
+
computeValue: (compilerOptions) => {
|
|
16521
|
+
return compilerOptions.useDefineForClassFields === void 0 ? computedOptions.target.computeValue(compilerOptions) >= 9 /* ES2022 */ : compilerOptions.useDefineForClassFields;
|
|
16522
|
+
}
|
|
16523
|
+
},
|
|
16524
|
+
noImplicitAny: {
|
|
16525
|
+
dependencies: ["strict"],
|
|
16526
|
+
computeValue: (compilerOptions) => {
|
|
16527
|
+
return getStrictOptionValue(compilerOptions, "noImplicitAny");
|
|
16528
|
+
}
|
|
16529
|
+
},
|
|
16530
|
+
noImplicitThis: {
|
|
16531
|
+
dependencies: ["strict"],
|
|
16532
|
+
computeValue: (compilerOptions) => {
|
|
16533
|
+
return getStrictOptionValue(compilerOptions, "noImplicitThis");
|
|
16534
|
+
}
|
|
16535
|
+
},
|
|
16536
|
+
strictNullChecks: {
|
|
16537
|
+
dependencies: ["strict"],
|
|
16538
|
+
computeValue: (compilerOptions) => {
|
|
16539
|
+
return getStrictOptionValue(compilerOptions, "strictNullChecks");
|
|
16540
|
+
}
|
|
16541
|
+
},
|
|
16542
|
+
strictFunctionTypes: {
|
|
16543
|
+
dependencies: ["strict"],
|
|
16544
|
+
computeValue: (compilerOptions) => {
|
|
16545
|
+
return getStrictOptionValue(compilerOptions, "strictFunctionTypes");
|
|
16546
|
+
}
|
|
16547
|
+
},
|
|
16548
|
+
strictBindCallApply: {
|
|
16549
|
+
dependencies: ["strict"],
|
|
16550
|
+
computeValue: (compilerOptions) => {
|
|
16551
|
+
return getStrictOptionValue(compilerOptions, "strictBindCallApply");
|
|
16552
|
+
}
|
|
16553
|
+
},
|
|
16554
|
+
strictPropertyInitialization: {
|
|
16555
|
+
dependencies: ["strict"],
|
|
16556
|
+
computeValue: (compilerOptions) => {
|
|
16557
|
+
return getStrictOptionValue(compilerOptions, "strictPropertyInitialization");
|
|
16558
|
+
}
|
|
16559
|
+
},
|
|
16560
|
+
alwaysStrict: {
|
|
16561
|
+
dependencies: ["strict"],
|
|
16562
|
+
computeValue: (compilerOptions) => {
|
|
16563
|
+
return getStrictOptionValue(compilerOptions, "alwaysStrict");
|
|
16564
|
+
}
|
|
16565
|
+
},
|
|
16566
|
+
useUnknownInCatchVariables: {
|
|
16567
|
+
dependencies: ["strict"],
|
|
16568
|
+
computeValue: (compilerOptions) => {
|
|
16569
|
+
return getStrictOptionValue(compilerOptions, "useUnknownInCatchVariables");
|
|
16570
|
+
}
|
|
16571
|
+
}
|
|
16572
|
+
});
|
|
16573
|
+
var getEmitScriptTarget = computedOptions.target.computeValue;
|
|
16574
|
+
var getEmitModuleKind = computedOptions.module.computeValue;
|
|
16575
|
+
var getEmitModuleResolutionKind = computedOptions.moduleResolution.computeValue;
|
|
16576
|
+
var getEmitModuleDetectionKind = computedOptions.moduleDetection.computeValue;
|
|
16577
|
+
var getIsolatedModules = computedOptions.isolatedModules.computeValue;
|
|
16578
|
+
var getESModuleInterop = computedOptions.esModuleInterop.computeValue;
|
|
16579
|
+
var getAllowSyntheticDefaultImports = computedOptions.allowSyntheticDefaultImports.computeValue;
|
|
16580
|
+
var getResolvePackageJsonExports = computedOptions.resolvePackageJsonExports.computeValue;
|
|
16581
|
+
var getResolvePackageJsonImports = computedOptions.resolvePackageJsonImports.computeValue;
|
|
16582
|
+
var getResolveJsonModule = computedOptions.resolveJsonModule.computeValue;
|
|
16583
|
+
var getEmitDeclarations = computedOptions.declaration.computeValue;
|
|
16584
|
+
var shouldPreserveConstEnums = computedOptions.preserveConstEnums.computeValue;
|
|
16585
|
+
var isIncrementalCompilation = computedOptions.incremental.computeValue;
|
|
16586
|
+
var getAreDeclarationMapsEnabled = computedOptions.declarationMap.computeValue;
|
|
16587
|
+
var getAllowJSCompilerOption = computedOptions.allowJs.computeValue;
|
|
16588
|
+
var getUseDefineForClassFields = computedOptions.useDefineForClassFields.computeValue;
|
|
16371
16589
|
function emitModuleKindIsNonNodeESM(moduleKind) {
|
|
16372
16590
|
return moduleKind >= 5 /* ES2015 */ && moduleKind <= 99 /* ESNext */;
|
|
16373
16591
|
}
|
|
16374
|
-
function getEmitModuleResolutionKind(compilerOptions) {
|
|
16375
|
-
let moduleResolution = compilerOptions.moduleResolution;
|
|
16376
|
-
if (moduleResolution === void 0) {
|
|
16377
|
-
switch (getEmitModuleKind(compilerOptions)) {
|
|
16378
|
-
case 1 /* CommonJS */:
|
|
16379
|
-
moduleResolution = 2 /* Node10 */;
|
|
16380
|
-
break;
|
|
16381
|
-
case 100 /* Node16 */:
|
|
16382
|
-
moduleResolution = 3 /* Node16 */;
|
|
16383
|
-
break;
|
|
16384
|
-
case 199 /* NodeNext */:
|
|
16385
|
-
moduleResolution = 99 /* NodeNext */;
|
|
16386
|
-
break;
|
|
16387
|
-
default:
|
|
16388
|
-
moduleResolution = 1 /* Classic */;
|
|
16389
|
-
break;
|
|
16390
|
-
}
|
|
16391
|
-
}
|
|
16392
|
-
return moduleResolution;
|
|
16393
|
-
}
|
|
16394
|
-
function getEmitModuleDetectionKind(options) {
|
|
16395
|
-
return options.moduleDetection || (getEmitModuleKind(options) === 100 /* Node16 */ || getEmitModuleKind(options) === 199 /* NodeNext */ ? 3 /* Force */ : 2 /* Auto */);
|
|
16396
|
-
}
|
|
16397
16592
|
function hasJsonModuleEmitEnabled(options) {
|
|
16398
16593
|
switch (getEmitModuleKind(options)) {
|
|
16399
16594
|
case 1 /* CommonJS */:
|
|
@@ -16409,81 +16604,21 @@ function hasJsonModuleEmitEnabled(options) {
|
|
|
16409
16604
|
return false;
|
|
16410
16605
|
}
|
|
16411
16606
|
}
|
|
16412
|
-
function getIsolatedModules(options) {
|
|
16413
|
-
return !!(options.isolatedModules || options.verbatimModuleSyntax);
|
|
16414
|
-
}
|
|
16415
16607
|
function unreachableCodeIsError(options) {
|
|
16416
16608
|
return options.allowUnreachableCode === false;
|
|
16417
16609
|
}
|
|
16418
16610
|
function unusedLabelIsError(options) {
|
|
16419
16611
|
return options.allowUnusedLabels === false;
|
|
16420
16612
|
}
|
|
16421
|
-
function getAreDeclarationMapsEnabled(options) {
|
|
16422
|
-
return !!(getEmitDeclarations(options) && options.declarationMap);
|
|
16423
|
-
}
|
|
16424
|
-
function getESModuleInterop(compilerOptions) {
|
|
16425
|
-
if (compilerOptions.esModuleInterop !== void 0) {
|
|
16426
|
-
return compilerOptions.esModuleInterop;
|
|
16427
|
-
}
|
|
16428
|
-
switch (getEmitModuleKind(compilerOptions)) {
|
|
16429
|
-
case 100 /* Node16 */:
|
|
16430
|
-
case 199 /* NodeNext */:
|
|
16431
|
-
return true;
|
|
16432
|
-
}
|
|
16433
|
-
return void 0;
|
|
16434
|
-
}
|
|
16435
|
-
function getAllowSyntheticDefaultImports(compilerOptions) {
|
|
16436
|
-
if (compilerOptions.allowSyntheticDefaultImports !== void 0) {
|
|
16437
|
-
return compilerOptions.allowSyntheticDefaultImports;
|
|
16438
|
-
}
|
|
16439
|
-
return getESModuleInterop(compilerOptions) || getEmitModuleKind(compilerOptions) === 4 /* System */ || getEmitModuleResolutionKind(compilerOptions) === 100 /* Bundler */;
|
|
16440
|
-
}
|
|
16441
16613
|
function moduleResolutionSupportsPackageJsonExportsAndImports(moduleResolution) {
|
|
16442
16614
|
return moduleResolution >= 3 /* Node16 */ && moduleResolution <= 99 /* NodeNext */ || moduleResolution === 100 /* Bundler */;
|
|
16443
16615
|
}
|
|
16444
16616
|
function shouldResolveJsRequire(compilerOptions) {
|
|
16445
16617
|
return !!compilerOptions.noDtsResolution || getEmitModuleResolutionKind(compilerOptions) !== 100 /* Bundler */;
|
|
16446
16618
|
}
|
|
16447
|
-
function getResolvePackageJsonExports(compilerOptions) {
|
|
16448
|
-
const moduleResolution = getEmitModuleResolutionKind(compilerOptions);
|
|
16449
|
-
if (!moduleResolutionSupportsPackageJsonExportsAndImports(moduleResolution)) {
|
|
16450
|
-
return false;
|
|
16451
|
-
}
|
|
16452
|
-
if (compilerOptions.resolvePackageJsonExports !== void 0) {
|
|
16453
|
-
return compilerOptions.resolvePackageJsonExports;
|
|
16454
|
-
}
|
|
16455
|
-
switch (moduleResolution) {
|
|
16456
|
-
case 3 /* Node16 */:
|
|
16457
|
-
case 99 /* NodeNext */:
|
|
16458
|
-
case 100 /* Bundler */:
|
|
16459
|
-
return true;
|
|
16460
|
-
}
|
|
16461
|
-
return false;
|
|
16462
|
-
}
|
|
16463
|
-
function getResolveJsonModule(compilerOptions) {
|
|
16464
|
-
if (compilerOptions.resolveJsonModule !== void 0) {
|
|
16465
|
-
return compilerOptions.resolveJsonModule;
|
|
16466
|
-
}
|
|
16467
|
-
return getEmitModuleResolutionKind(compilerOptions) === 100 /* Bundler */;
|
|
16468
|
-
}
|
|
16469
|
-
function getEmitDeclarations(compilerOptions) {
|
|
16470
|
-
return !!(compilerOptions.declaration || compilerOptions.composite);
|
|
16471
|
-
}
|
|
16472
|
-
function shouldPreserveConstEnums(compilerOptions) {
|
|
16473
|
-
return !!(compilerOptions.preserveConstEnums || getIsolatedModules(compilerOptions));
|
|
16474
|
-
}
|
|
16475
|
-
function isIncrementalCompilation(options) {
|
|
16476
|
-
return !!(options.incremental || options.composite);
|
|
16477
|
-
}
|
|
16478
16619
|
function getStrictOptionValue(compilerOptions, flag) {
|
|
16479
16620
|
return compilerOptions[flag] === void 0 ? !!compilerOptions.strict : !!compilerOptions[flag];
|
|
16480
16621
|
}
|
|
16481
|
-
function getAllowJSCompilerOption(compilerOptions) {
|
|
16482
|
-
return compilerOptions.allowJs === void 0 ? !!compilerOptions.checkJs : compilerOptions.allowJs;
|
|
16483
|
-
}
|
|
16484
|
-
function getUseDefineForClassFields(compilerOptions) {
|
|
16485
|
-
return compilerOptions.useDefineForClassFields === void 0 ? getEmitScriptTarget(compilerOptions) >= 9 /* ES2022 */ : compilerOptions.useDefineForClassFields;
|
|
16486
|
-
}
|
|
16487
16622
|
function getEmitStandardClassFields(compilerOptions) {
|
|
16488
16623
|
return compilerOptions.useDefineForClassFields !== false && getEmitScriptTarget(compilerOptions) >= 9 /* ES2022 */;
|
|
16489
16624
|
}
|
|
@@ -35895,7 +36030,8 @@ function convertToTSConfig(configParseResult, configFileName, host) {
|
|
|
35895
36030
|
),
|
|
35896
36031
|
(f) => getRelativePathFromFile(getNormalizedAbsolutePath(configFileName, host.getCurrentDirectory()), getNormalizedAbsolutePath(f, host.getCurrentDirectory()), getCanonicalFileName)
|
|
35897
36032
|
);
|
|
35898
|
-
const
|
|
36033
|
+
const pathOptions = { configFilePath: getNormalizedAbsolutePath(configFileName, host.getCurrentDirectory()), useCaseSensitiveFileNames: host.useCaseSensitiveFileNames };
|
|
36034
|
+
const optionMap = serializeCompilerOptions(configParseResult.options, pathOptions);
|
|
35899
36035
|
const watchOptionMap = configParseResult.watchOptions && serializeWatchOptions(configParseResult.watchOptions);
|
|
35900
36036
|
const config = {
|
|
35901
36037
|
compilerOptions: {
|
|
@@ -35920,6 +36056,18 @@ function convertToTSConfig(configParseResult, configFileName, host) {
|
|
|
35920
36056
|
} : {},
|
|
35921
36057
|
compileOnSave: !!configParseResult.compileOnSave ? true : void 0
|
|
35922
36058
|
};
|
|
36059
|
+
const providedKeys = new Set(optionMap.keys());
|
|
36060
|
+
const impliedCompilerOptions = {};
|
|
36061
|
+
for (const option in computedOptions) {
|
|
36062
|
+
if (!providedKeys.has(option) && some(computedOptions[option].dependencies, (dep) => providedKeys.has(dep))) {
|
|
36063
|
+
const implied = computedOptions[option].computeValue(configParseResult.options);
|
|
36064
|
+
const defaultValue = computedOptions[option].computeValue({});
|
|
36065
|
+
if (implied !== defaultValue) {
|
|
36066
|
+
impliedCompilerOptions[option] = computedOptions[option].computeValue(configParseResult.options);
|
|
36067
|
+
}
|
|
36068
|
+
}
|
|
36069
|
+
}
|
|
36070
|
+
assign(config.compilerOptions, optionMapToObject(serializeCompilerOptions(impliedCompilerOptions, pathOptions)));
|
|
35923
36071
|
return config;
|
|
35924
36072
|
}
|
|
35925
36073
|
function optionMapToObject(optionMap) {
|
|
@@ -57114,7 +57262,7 @@ function createTypeChecker(host) {
|
|
|
57114
57262
|
function removeConstrainedTypeVariables(types) {
|
|
57115
57263
|
const typeVariables = [];
|
|
57116
57264
|
for (const type of types) {
|
|
57117
|
-
if (getObjectFlags(type) & 67108864 /* IsConstrainedTypeVariable */) {
|
|
57265
|
+
if (type.flags & 2097152 /* Intersection */ && getObjectFlags(type) & 67108864 /* IsConstrainedTypeVariable */) {
|
|
57118
57266
|
const index = type.types[0].flags & 8650752 /* TypeVariable */ ? 0 : 1;
|
|
57119
57267
|
pushIfUnique(typeVariables, type.types[index]);
|
|
57120
57268
|
}
|
|
@@ -57122,7 +57270,7 @@ function createTypeChecker(host) {
|
|
|
57122
57270
|
for (const typeVariable of typeVariables) {
|
|
57123
57271
|
const primitives = [];
|
|
57124
57272
|
for (const type of types) {
|
|
57125
|
-
if (getObjectFlags(type) & 67108864 /* IsConstrainedTypeVariable */) {
|
|
57273
|
+
if (type.flags & 2097152 /* Intersection */ && getObjectFlags(type) & 67108864 /* IsConstrainedTypeVariable */) {
|
|
57126
57274
|
const index = type.types[0].flags & 8650752 /* TypeVariable */ ? 0 : 1;
|
|
57127
57275
|
if (type.types[index] === typeVariable) {
|
|
57128
57276
|
insertType(primitives, type.types[1 - index]);
|
|
@@ -57135,7 +57283,7 @@ function createTypeChecker(host) {
|
|
|
57135
57283
|
while (i > 0) {
|
|
57136
57284
|
i--;
|
|
57137
57285
|
const type = types[i];
|
|
57138
|
-
if (getObjectFlags(type) & 67108864 /* IsConstrainedTypeVariable */) {
|
|
57286
|
+
if (type.flags & 2097152 /* Intersection */ && getObjectFlags(type) & 67108864 /* IsConstrainedTypeVariable */) {
|
|
57139
57287
|
const index = type.types[0].flags & 8650752 /* TypeVariable */ ? 0 : 1;
|
|
57140
57288
|
if (type.types[index] === typeVariable && containsType(primitives, type.types[1 - index])) {
|
|
57141
57289
|
orderedRemoveItemAt(types, i);
|
|
@@ -58303,7 +58451,9 @@ function createTypeChecker(host) {
|
|
|
58303
58451
|
if (checkType === wildcardType || extendsType === wildcardType) {
|
|
58304
58452
|
return wildcardType;
|
|
58305
58453
|
}
|
|
58306
|
-
const
|
|
58454
|
+
const checkTypeNode = skipTypeParentheses(root.node.checkType);
|
|
58455
|
+
const extendsTypeNode = skipTypeParentheses(root.node.extendsType);
|
|
58456
|
+
const checkTuples = isSimpleTupleType(checkTypeNode) && isSimpleTupleType(extendsTypeNode) && length(checkTypeNode.elements) === length(extendsTypeNode.elements);
|
|
58307
58457
|
const checkTypeDeferred = isDeferredType(checkType, checkTuples);
|
|
58308
58458
|
let combinedMapper;
|
|
58309
58459
|
if (root.inferTypeParameters) {
|
|
@@ -68802,7 +68952,7 @@ function createTypeChecker(host) {
|
|
|
68802
68952
|
/*contextFlags*/
|
|
68803
68953
|
void 0
|
|
68804
68954
|
);
|
|
68805
|
-
const inTupleContext = isSpreadIntoCallOrNew(node) || !!contextualType && someType(contextualType,
|
|
68955
|
+
const inTupleContext = isSpreadIntoCallOrNew(node) || !!contextualType && someType(contextualType, isTupleLikeType);
|
|
68806
68956
|
let hasOmittedExpression = false;
|
|
68807
68957
|
for (let i = 0; i < elementCount; i++) {
|
|
68808
68958
|
const e = elements[i];
|
|
@@ -75730,7 +75880,7 @@ function createTypeChecker(host) {
|
|
|
75730
75880
|
const modifiers = getTypeParameterModifiers(typeParameter) & (8192 /* In */ | 16384 /* Out */);
|
|
75731
75881
|
if (modifiers) {
|
|
75732
75882
|
const symbol = getSymbolOfDeclaration(node.parent);
|
|
75733
|
-
if (isTypeAliasDeclaration(node.parent) && !(getObjectFlags(getDeclaredTypeOfSymbol(symbol)) & (16 /* Anonymous */ | 32 /* Mapped */))) {
|
|
75883
|
+
if (isTypeAliasDeclaration(node.parent) && !(getObjectFlags(getDeclaredTypeOfSymbol(symbol)) & (4 /* Reference */ | 16 /* Anonymous */ | 32 /* Mapped */))) {
|
|
75734
75884
|
error(node, Diagnostics.Variance_annotations_are_only_supported_in_type_aliases_for_object_function_constructor_and_mapped_types);
|
|
75735
75885
|
} else if (modifiers === 8192 /* In */ || modifiers === 16384 /* Out */) {
|
|
75736
75886
|
(_a = tracing) == null ? void 0 : _a.push(tracing.Phase.CheckTypes, "checkTypeParameterDeferred", { parent: getTypeId(getDeclaredTypeOfSymbol(symbol)), id: getTypeId(typeParameter) });
|
|
@@ -80038,14 +80188,16 @@ function createTypeChecker(host) {
|
|
|
80038
80188
|
if (!(nodeLinks2.flags & 1024 /* EnumValuesComputed */)) {
|
|
80039
80189
|
nodeLinks2.flags |= 1024 /* EnumValuesComputed */;
|
|
80040
80190
|
let autoValue = 0;
|
|
80191
|
+
let previous;
|
|
80041
80192
|
for (const member of node.members) {
|
|
80042
|
-
const value = computeMemberValue(member, autoValue);
|
|
80193
|
+
const value = computeMemberValue(member, autoValue, previous);
|
|
80043
80194
|
getNodeLinks(member).enumMemberValue = value;
|
|
80044
80195
|
autoValue = typeof value === "number" ? value + 1 : void 0;
|
|
80196
|
+
previous = member;
|
|
80045
80197
|
}
|
|
80046
80198
|
}
|
|
80047
80199
|
}
|
|
80048
|
-
function computeMemberValue(member, autoValue) {
|
|
80200
|
+
function computeMemberValue(member, autoValue, previous) {
|
|
80049
80201
|
if (isComputedNonLiteralName(member.name)) {
|
|
80050
80202
|
error(member.name, Diagnostics.Computed_property_names_are_not_allowed_in_enums);
|
|
80051
80203
|
} else {
|
|
@@ -80060,11 +80212,17 @@ function createTypeChecker(host) {
|
|
|
80060
80212
|
if (member.parent.flags & 33554432 /* Ambient */ && !isEnumConst(member.parent)) {
|
|
80061
80213
|
return void 0;
|
|
80062
80214
|
}
|
|
80063
|
-
if (autoValue
|
|
80064
|
-
|
|
80215
|
+
if (autoValue === void 0) {
|
|
80216
|
+
error(member.name, Diagnostics.Enum_member_must_have_initializer);
|
|
80217
|
+
return void 0;
|
|
80065
80218
|
}
|
|
80066
|
-
|
|
80067
|
-
|
|
80219
|
+
if (compilerOptions.isolatedModules && (previous == null ? void 0 : previous.initializer) && !evaluatesToNumericLiteral(previous.initializer)) {
|
|
80220
|
+
error(
|
|
80221
|
+
member.name,
|
|
80222
|
+
Diagnostics.Enum_member_following_a_non_literal_numeric_member_must_have_an_initializer_when_isolatedModules_is_enabled
|
|
80223
|
+
);
|
|
80224
|
+
}
|
|
80225
|
+
return autoValue;
|
|
80068
80226
|
}
|
|
80069
80227
|
function computeConstantValue(member) {
|
|
80070
80228
|
const isConstEnum = isEnumConst(member.parent);
|
|
@@ -80076,6 +80234,11 @@ function createTypeChecker(host) {
|
|
|
80076
80234
|
initializer,
|
|
80077
80235
|
isNaN(value) ? Diagnostics.const_enum_member_initializer_was_evaluated_to_disallowed_value_NaN : Diagnostics.const_enum_member_initializer_was_evaluated_to_a_non_finite_value
|
|
80078
80236
|
);
|
|
80237
|
+
} else if (compilerOptions.isolatedModules && typeof value === "string" && !evaluatesToStringLiteral(initializer)) {
|
|
80238
|
+
error(
|
|
80239
|
+
initializer,
|
|
80240
|
+
Diagnostics.A_member_initializer_in_a_enum_declaration_for_a_string_value_must_be_a_string_literal_when_isolatedModules_is_enabled
|
|
80241
|
+
);
|
|
80079
80242
|
}
|
|
80080
80243
|
} else if (isConstEnum) {
|
|
80081
80244
|
error(initializer, Diagnostics.const_enum_member_initializers_must_be_constant_expressions);
|
|
@@ -80086,6 +80249,37 @@ function createTypeChecker(host) {
|
|
|
80086
80249
|
}
|
|
80087
80250
|
return value;
|
|
80088
80251
|
}
|
|
80252
|
+
function evaluatesToNumericLiteral(expr) {
|
|
80253
|
+
switch (expr.kind) {
|
|
80254
|
+
case 224 /* PrefixUnaryExpression */:
|
|
80255
|
+
return evaluatesToNumericLiteral(expr.operand);
|
|
80256
|
+
case 226 /* BinaryExpression */:
|
|
80257
|
+
return evaluatesToNumericLiteral(expr.left) && evaluatesToNumericLiteral(expr.right);
|
|
80258
|
+
case 217 /* ParenthesizedExpression */:
|
|
80259
|
+
return evaluatesToNumericLiteral(expr.expression);
|
|
80260
|
+
case 9 /* NumericLiteral */:
|
|
80261
|
+
return true;
|
|
80262
|
+
}
|
|
80263
|
+
return false;
|
|
80264
|
+
}
|
|
80265
|
+
function evaluatesToStringLiteral(expr) {
|
|
80266
|
+
switch (expr.kind) {
|
|
80267
|
+
case 226 /* BinaryExpression */:
|
|
80268
|
+
const left = expr.left;
|
|
80269
|
+
const right = expr.right;
|
|
80270
|
+
const leftIsNumeric = evaluatesToNumericLiteral(left);
|
|
80271
|
+
const rightIsNumeric = evaluatesToNumericLiteral(right);
|
|
80272
|
+
return !(leftIsNumeric && rightIsNumeric) && (evaluatesToStringLiteral(left) || leftIsNumeric) && (evaluatesToStringLiteral(right) || rightIsNumeric) && expr.operatorToken.kind === 40 /* PlusToken */;
|
|
80273
|
+
case 228 /* TemplateExpression */:
|
|
80274
|
+
return expr.templateSpans.every((span) => evaluatesToStringLiteral(span.expression));
|
|
80275
|
+
case 217 /* ParenthesizedExpression */:
|
|
80276
|
+
return evaluatesToStringLiteral(expr.expression);
|
|
80277
|
+
case 11 /* StringLiteral */:
|
|
80278
|
+
case 15 /* NoSubstitutionTemplateLiteral */:
|
|
80279
|
+
return true;
|
|
80280
|
+
}
|
|
80281
|
+
return false;
|
|
80282
|
+
}
|
|
80089
80283
|
function evaluate(expr, location) {
|
|
80090
80284
|
switch (expr.kind) {
|
|
80091
80285
|
case 224 /* PrefixUnaryExpression */:
|