typescript 5.4.0-dev.20231207 → 5.4.0-dev.20231209

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 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.20231207`;
21
+ var version = `${versionMajorMinor}.0-dev.20231209`;
22
22
 
23
23
  // src/compiler/core.ts
24
24
  var emptyArray = [];
@@ -16362,38 +16362,231 @@ function getSetExternalModuleIndicator(options) {
16362
16362
  return callback;
16363
16363
  }
16364
16364
  }
16365
- function getEmitScriptTarget(compilerOptions) {
16366
- return compilerOptions.target ?? (compilerOptions.module === 100 /* Node16 */ && 9 /* ES2022 */ || compilerOptions.module === 199 /* NodeNext */ && 99 /* ESNext */ || 1 /* ES5 */);
16367
- }
16368
- function getEmitModuleKind(compilerOptions) {
16369
- return typeof compilerOptions.module === "number" ? compilerOptions.module : getEmitScriptTarget(compilerOptions) >= 2 /* ES2015 */ ? 5 /* ES2015 */ : 1 /* CommonJS */;
16365
+ function createComputedCompilerOptions(options) {
16366
+ return options;
16370
16367
  }
16368
+ var computedOptions = createComputedCompilerOptions({
16369
+ target: {
16370
+ dependencies: ["module"],
16371
+ computeValue: (compilerOptions) => {
16372
+ return compilerOptions.target ?? (compilerOptions.module === 100 /* Node16 */ && 9 /* ES2022 */ || compilerOptions.module === 199 /* NodeNext */ && 99 /* ESNext */ || 1 /* ES5 */);
16373
+ }
16374
+ },
16375
+ module: {
16376
+ dependencies: ["target"],
16377
+ computeValue: (compilerOptions) => {
16378
+ return typeof compilerOptions.module === "number" ? compilerOptions.module : computedOptions.target.computeValue(compilerOptions) >= 2 /* ES2015 */ ? 5 /* ES2015 */ : 1 /* CommonJS */;
16379
+ }
16380
+ },
16381
+ moduleResolution: {
16382
+ dependencies: ["module", "target"],
16383
+ computeValue: (compilerOptions) => {
16384
+ let moduleResolution = compilerOptions.moduleResolution;
16385
+ if (moduleResolution === void 0) {
16386
+ switch (computedOptions.module.computeValue(compilerOptions)) {
16387
+ case 1 /* CommonJS */:
16388
+ moduleResolution = 2 /* Node10 */;
16389
+ break;
16390
+ case 100 /* Node16 */:
16391
+ moduleResolution = 3 /* Node16 */;
16392
+ break;
16393
+ case 199 /* NodeNext */:
16394
+ moduleResolution = 99 /* NodeNext */;
16395
+ break;
16396
+ default:
16397
+ moduleResolution = 1 /* Classic */;
16398
+ break;
16399
+ }
16400
+ }
16401
+ return moduleResolution;
16402
+ }
16403
+ },
16404
+ moduleDetection: {
16405
+ dependencies: ["module", "target"],
16406
+ computeValue: (compilerOptions) => {
16407
+ return compilerOptions.moduleDetection || (computedOptions.module.computeValue(compilerOptions) === 100 /* Node16 */ || computedOptions.module.computeValue(compilerOptions) === 199 /* NodeNext */ ? 3 /* Force */ : 2 /* Auto */);
16408
+ }
16409
+ },
16410
+ isolatedModules: {
16411
+ dependencies: ["verbatimModuleSyntax"],
16412
+ computeValue: (compilerOptions) => {
16413
+ return !!(compilerOptions.isolatedModules || compilerOptions.verbatimModuleSyntax);
16414
+ }
16415
+ },
16416
+ esModuleInterop: {
16417
+ dependencies: ["module", "target"],
16418
+ computeValue: (compilerOptions) => {
16419
+ if (compilerOptions.esModuleInterop !== void 0) {
16420
+ return compilerOptions.esModuleInterop;
16421
+ }
16422
+ switch (computedOptions.module.computeValue(compilerOptions)) {
16423
+ case 100 /* Node16 */:
16424
+ case 199 /* NodeNext */:
16425
+ return true;
16426
+ }
16427
+ return false;
16428
+ }
16429
+ },
16430
+ allowSyntheticDefaultImports: {
16431
+ dependencies: ["module", "target", "moduleResolution"],
16432
+ computeValue: (compilerOptions) => {
16433
+ if (compilerOptions.allowSyntheticDefaultImports !== void 0) {
16434
+ return compilerOptions.allowSyntheticDefaultImports;
16435
+ }
16436
+ return computedOptions.esModuleInterop.computeValue(compilerOptions) || computedOptions.module.computeValue(compilerOptions) === 4 /* System */ || computedOptions.moduleResolution.computeValue(compilerOptions) === 100 /* Bundler */;
16437
+ }
16438
+ },
16439
+ resolvePackageJsonExports: {
16440
+ dependencies: ["moduleResolution"],
16441
+ computeValue: (compilerOptions) => {
16442
+ const moduleResolution = computedOptions.moduleResolution.computeValue(compilerOptions);
16443
+ if (!moduleResolutionSupportsPackageJsonExportsAndImports(moduleResolution)) {
16444
+ return false;
16445
+ }
16446
+ if (compilerOptions.resolvePackageJsonExports !== void 0) {
16447
+ return compilerOptions.resolvePackageJsonExports;
16448
+ }
16449
+ switch (moduleResolution) {
16450
+ case 3 /* Node16 */:
16451
+ case 99 /* NodeNext */:
16452
+ case 100 /* Bundler */:
16453
+ return true;
16454
+ }
16455
+ return false;
16456
+ }
16457
+ },
16458
+ resolvePackageJsonImports: {
16459
+ dependencies: ["moduleResolution", "resolvePackageJsonExports"],
16460
+ computeValue: (compilerOptions) => {
16461
+ const moduleResolution = computedOptions.moduleResolution.computeValue(compilerOptions);
16462
+ if (!moduleResolutionSupportsPackageJsonExportsAndImports(moduleResolution)) {
16463
+ return false;
16464
+ }
16465
+ if (compilerOptions.resolvePackageJsonExports !== void 0) {
16466
+ return compilerOptions.resolvePackageJsonExports;
16467
+ }
16468
+ switch (moduleResolution) {
16469
+ case 3 /* Node16 */:
16470
+ case 99 /* NodeNext */:
16471
+ case 100 /* Bundler */:
16472
+ return true;
16473
+ }
16474
+ return false;
16475
+ }
16476
+ },
16477
+ resolveJsonModule: {
16478
+ dependencies: ["moduleResolution", "module", "target"],
16479
+ computeValue: (compilerOptions) => {
16480
+ if (compilerOptions.resolveJsonModule !== void 0) {
16481
+ return compilerOptions.resolveJsonModule;
16482
+ }
16483
+ return computedOptions.moduleResolution.computeValue(compilerOptions) === 100 /* Bundler */;
16484
+ }
16485
+ },
16486
+ declaration: {
16487
+ dependencies: ["composite"],
16488
+ computeValue: (compilerOptions) => {
16489
+ return !!(compilerOptions.declaration || compilerOptions.composite);
16490
+ }
16491
+ },
16492
+ preserveConstEnums: {
16493
+ dependencies: ["isolatedModules", "verbatimModuleSyntax"],
16494
+ computeValue: (compilerOptions) => {
16495
+ return !!(compilerOptions.preserveConstEnums || computedOptions.isolatedModules.computeValue(compilerOptions));
16496
+ }
16497
+ },
16498
+ incremental: {
16499
+ dependencies: ["composite"],
16500
+ computeValue: (compilerOptions) => {
16501
+ return !!(compilerOptions.incremental || compilerOptions.composite);
16502
+ }
16503
+ },
16504
+ declarationMap: {
16505
+ dependencies: ["declaration", "composite"],
16506
+ computeValue: (compilerOptions) => {
16507
+ return !!(compilerOptions.declarationMap && computedOptions.declaration.computeValue(compilerOptions));
16508
+ }
16509
+ },
16510
+ allowJs: {
16511
+ dependencies: ["checkJs"],
16512
+ computeValue: (compilerOptions) => {
16513
+ return compilerOptions.allowJs === void 0 ? !!compilerOptions.checkJs : compilerOptions.allowJs;
16514
+ }
16515
+ },
16516
+ useDefineForClassFields: {
16517
+ dependencies: ["target", "module"],
16518
+ computeValue: (compilerOptions) => {
16519
+ return compilerOptions.useDefineForClassFields === void 0 ? computedOptions.target.computeValue(compilerOptions) >= 9 /* ES2022 */ : compilerOptions.useDefineForClassFields;
16520
+ }
16521
+ },
16522
+ noImplicitAny: {
16523
+ dependencies: ["strict"],
16524
+ computeValue: (compilerOptions) => {
16525
+ return getStrictOptionValue(compilerOptions, "noImplicitAny");
16526
+ }
16527
+ },
16528
+ noImplicitThis: {
16529
+ dependencies: ["strict"],
16530
+ computeValue: (compilerOptions) => {
16531
+ return getStrictOptionValue(compilerOptions, "noImplicitThis");
16532
+ }
16533
+ },
16534
+ strictNullChecks: {
16535
+ dependencies: ["strict"],
16536
+ computeValue: (compilerOptions) => {
16537
+ return getStrictOptionValue(compilerOptions, "strictNullChecks");
16538
+ }
16539
+ },
16540
+ strictFunctionTypes: {
16541
+ dependencies: ["strict"],
16542
+ computeValue: (compilerOptions) => {
16543
+ return getStrictOptionValue(compilerOptions, "strictFunctionTypes");
16544
+ }
16545
+ },
16546
+ strictBindCallApply: {
16547
+ dependencies: ["strict"],
16548
+ computeValue: (compilerOptions) => {
16549
+ return getStrictOptionValue(compilerOptions, "strictBindCallApply");
16550
+ }
16551
+ },
16552
+ strictPropertyInitialization: {
16553
+ dependencies: ["strict"],
16554
+ computeValue: (compilerOptions) => {
16555
+ return getStrictOptionValue(compilerOptions, "strictPropertyInitialization");
16556
+ }
16557
+ },
16558
+ alwaysStrict: {
16559
+ dependencies: ["strict"],
16560
+ computeValue: (compilerOptions) => {
16561
+ return getStrictOptionValue(compilerOptions, "alwaysStrict");
16562
+ }
16563
+ },
16564
+ useUnknownInCatchVariables: {
16565
+ dependencies: ["strict"],
16566
+ computeValue: (compilerOptions) => {
16567
+ return getStrictOptionValue(compilerOptions, "useUnknownInCatchVariables");
16568
+ }
16569
+ }
16570
+ });
16571
+ var getEmitScriptTarget = computedOptions.target.computeValue;
16572
+ var getEmitModuleKind = computedOptions.module.computeValue;
16573
+ var getEmitModuleResolutionKind = computedOptions.moduleResolution.computeValue;
16574
+ var getEmitModuleDetectionKind = computedOptions.moduleDetection.computeValue;
16575
+ var getIsolatedModules = computedOptions.isolatedModules.computeValue;
16576
+ var getESModuleInterop = computedOptions.esModuleInterop.computeValue;
16577
+ var getAllowSyntheticDefaultImports = computedOptions.allowSyntheticDefaultImports.computeValue;
16578
+ var getResolvePackageJsonExports = computedOptions.resolvePackageJsonExports.computeValue;
16579
+ var getResolvePackageJsonImports = computedOptions.resolvePackageJsonImports.computeValue;
16580
+ var getResolveJsonModule = computedOptions.resolveJsonModule.computeValue;
16581
+ var getEmitDeclarations = computedOptions.declaration.computeValue;
16582
+ var shouldPreserveConstEnums = computedOptions.preserveConstEnums.computeValue;
16583
+ var isIncrementalCompilation = computedOptions.incremental.computeValue;
16584
+ var getAreDeclarationMapsEnabled = computedOptions.declarationMap.computeValue;
16585
+ var getAllowJSCompilerOption = computedOptions.allowJs.computeValue;
16586
+ var getUseDefineForClassFields = computedOptions.useDefineForClassFields.computeValue;
16371
16587
  function emitModuleKindIsNonNodeESM(moduleKind) {
16372
16588
  return moduleKind >= 5 /* ES2015 */ && moduleKind <= 99 /* ESNext */;
16373
16589
  }
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
16590
  function hasJsonModuleEmitEnabled(options) {
16398
16591
  switch (getEmitModuleKind(options)) {
16399
16592
  case 1 /* CommonJS */:
@@ -16409,81 +16602,21 @@ function hasJsonModuleEmitEnabled(options) {
16409
16602
  return false;
16410
16603
  }
16411
16604
  }
16412
- function getIsolatedModules(options) {
16413
- return !!(options.isolatedModules || options.verbatimModuleSyntax);
16414
- }
16415
16605
  function unreachableCodeIsError(options) {
16416
16606
  return options.allowUnreachableCode === false;
16417
16607
  }
16418
16608
  function unusedLabelIsError(options) {
16419
16609
  return options.allowUnusedLabels === false;
16420
16610
  }
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
16611
  function moduleResolutionSupportsPackageJsonExportsAndImports(moduleResolution) {
16442
16612
  return moduleResolution >= 3 /* Node16 */ && moduleResolution <= 99 /* NodeNext */ || moduleResolution === 100 /* Bundler */;
16443
16613
  }
16444
16614
  function shouldResolveJsRequire(compilerOptions) {
16445
16615
  return !!compilerOptions.noDtsResolution || getEmitModuleResolutionKind(compilerOptions) !== 100 /* Bundler */;
16446
16616
  }
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
16617
  function getStrictOptionValue(compilerOptions, flag) {
16479
16618
  return compilerOptions[flag] === void 0 ? !!compilerOptions.strict : !!compilerOptions[flag];
16480
16619
  }
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
16620
  function getEmitStandardClassFields(compilerOptions) {
16488
16621
  return compilerOptions.useDefineForClassFields !== false && getEmitScriptTarget(compilerOptions) >= 9 /* ES2022 */;
16489
16622
  }
@@ -18839,8 +18972,10 @@ function createNodeFactory(flags, baseFactory2) {
18839
18972
  return update(updated, original);
18840
18973
  }
18841
18974
  function createNumericLiteral(value, numericLiteralFlags = 0 /* None */) {
18975
+ const text = typeof value === "number" ? value + "" : value;
18976
+ Debug.assert(text.charCodeAt(0) !== 45 /* minus */, "Negative numbers should be created in combination with createPrefixUnaryExpression");
18842
18977
  const node = createBaseDeclaration(9 /* NumericLiteral */);
18843
- node.text = typeof value === "number" ? value + "" : value;
18978
+ node.text = text;
18844
18979
  node.numericLiteralFlags = numericLiteralFlags;
18845
18980
  if (numericLiteralFlags & 384 /* BinaryOrOctalSpecifier */)
18846
18981
  node.transformFlags |= 1024 /* ContainsES2015 */;
@@ -35893,7 +36028,8 @@ function convertToTSConfig(configParseResult, configFileName, host) {
35893
36028
  ),
35894
36029
  (f) => getRelativePathFromFile(getNormalizedAbsolutePath(configFileName, host.getCurrentDirectory()), getNormalizedAbsolutePath(f, host.getCurrentDirectory()), getCanonicalFileName)
35895
36030
  );
35896
- const optionMap = serializeCompilerOptions(configParseResult.options, { configFilePath: getNormalizedAbsolutePath(configFileName, host.getCurrentDirectory()), useCaseSensitiveFileNames: host.useCaseSensitiveFileNames });
36031
+ const pathOptions = { configFilePath: getNormalizedAbsolutePath(configFileName, host.getCurrentDirectory()), useCaseSensitiveFileNames: host.useCaseSensitiveFileNames };
36032
+ const optionMap = serializeCompilerOptions(configParseResult.options, pathOptions);
35897
36033
  const watchOptionMap = configParseResult.watchOptions && serializeWatchOptions(configParseResult.watchOptions);
35898
36034
  const config = {
35899
36035
  compilerOptions: {
@@ -35918,6 +36054,18 @@ function convertToTSConfig(configParseResult, configFileName, host) {
35918
36054
  } : {},
35919
36055
  compileOnSave: !!configParseResult.compileOnSave ? true : void 0
35920
36056
  };
36057
+ const providedKeys = new Set(optionMap.keys());
36058
+ const impliedCompilerOptions = {};
36059
+ for (const option in computedOptions) {
36060
+ if (!providedKeys.has(option) && some(computedOptions[option].dependencies, (dep) => providedKeys.has(dep))) {
36061
+ const implied = computedOptions[option].computeValue(configParseResult.options);
36062
+ const defaultValue = computedOptions[option].computeValue({});
36063
+ if (implied !== defaultValue) {
36064
+ impliedCompilerOptions[option] = computedOptions[option].computeValue(configParseResult.options);
36065
+ }
36066
+ }
36067
+ }
36068
+ assign(config.compilerOptions, optionMapToObject(serializeCompilerOptions(impliedCompilerOptions, pathOptions)));
35921
36069
  return config;
35922
36070
  }
35923
36071
  function optionMapToObject(optionMap) {
@@ -49567,7 +49715,7 @@ function createTypeChecker(host) {
49567
49715
  return factory.createStringLiteral(name, !!singleQuote);
49568
49716
  }
49569
49717
  if (isNumericLiteralName(name) && startsWith(name, "-")) {
49570
- return factory.createComputedPropertyName(factory.createNumericLiteral(+name));
49718
+ return factory.createComputedPropertyName(factory.createPrefixUnaryExpression(41 /* MinusToken */, factory.createNumericLiteral(-name)));
49571
49719
  }
49572
49720
  return createPropertyNameNodeForIdentifierOrLiteral(name, getEmitScriptTarget(compilerOptions), singleQuote, stringNamed, isMethod);
49573
49721
  }
@@ -53633,11 +53781,10 @@ function createTypeChecker(host) {
53633
53781
  const baseTypes = getBaseTypes(source);
53634
53782
  if (baseTypes.length) {
53635
53783
  if (source.symbol && members === getMembersOfSymbol(source.symbol)) {
53636
- const symbolTable = createSymbolTable();
53637
- for (const symbol of members.values()) {
53638
- if (!(symbol.flags & 262144 /* TypeParameter */)) {
53639
- symbolTable.set(symbol.escapedName, symbol);
53640
- }
53784
+ const symbolTable = createSymbolTable(source.declaredProperties);
53785
+ const sourceIndex = getIndexSymbol(source.symbol);
53786
+ if (sourceIndex) {
53787
+ symbolTable.set("__index" /* Index */, sourceIndex);
53641
53788
  }
53642
53789
  members = symbolTable;
53643
53790
  }
@@ -58302,7 +58449,9 @@ function createTypeChecker(host) {
58302
58449
  if (checkType === wildcardType || extendsType === wildcardType) {
58303
58450
  return wildcardType;
58304
58451
  }
58305
- const checkTuples = isSimpleTupleType(root.node.checkType) && isSimpleTupleType(root.node.extendsType) && length(root.node.checkType.elements) === length(root.node.extendsType.elements);
58452
+ const checkTypeNode = skipTypeParentheses(root.node.checkType);
58453
+ const extendsTypeNode = skipTypeParentheses(root.node.extendsType);
58454
+ const checkTuples = isSimpleTupleType(checkTypeNode) && isSimpleTupleType(extendsTypeNode) && length(checkTypeNode.elements) === length(extendsTypeNode.elements);
58306
58455
  const checkTypeDeferred = isDeferredType(checkType, checkTuples);
58307
58456
  let combinedMapper;
58308
58457
  if (root.inferTypeParameters) {
@@ -82648,7 +82797,7 @@ function createTypeChecker(host) {
82648
82797
  if (enumResult)
82649
82798
  return enumResult;
82650
82799
  const literalValue = type.value;
82651
- return typeof literalValue === "object" ? factory.createBigIntLiteral(literalValue) : typeof literalValue === "number" ? factory.createNumericLiteral(literalValue) : factory.createStringLiteral(literalValue);
82800
+ return typeof literalValue === "object" ? factory.createBigIntLiteral(literalValue) : typeof literalValue === "string" ? factory.createStringLiteral(literalValue) : literalValue < 0 ? factory.createPrefixUnaryExpression(41 /* MinusToken */, factory.createNumericLiteral(-literalValue)) : factory.createNumericLiteral(literalValue);
82652
82801
  }
82653
82802
  function createLiteralConstValue(node, tracker) {
82654
82803
  const type = getTypeOfSymbol(getSymbolOfDeclaration(node));
@@ -89077,7 +89226,7 @@ function transformTypeScript(context) {
89077
89226
  function transformEnumMemberDeclarationValue(member) {
89078
89227
  const value = resolver.getConstantValue(member);
89079
89228
  if (value !== void 0) {
89080
- return typeof value === "string" ? factory2.createStringLiteral(value) : factory2.createNumericLiteral(value);
89229
+ return typeof value === "string" ? factory2.createStringLiteral(value) : value < 0 ? factory2.createPrefixUnaryExpression(41 /* MinusToken */, factory2.createNumericLiteral(-value)) : factory2.createNumericLiteral(value);
89081
89230
  } else {
89082
89231
  enableSubstitutionForNonQualifiedEnumMembers();
89083
89232
  if (member.initializer) {
@@ -89607,7 +89756,7 @@ function transformTypeScript(context) {
89607
89756
  const constantValue = tryGetConstEnumValue(node);
89608
89757
  if (constantValue !== void 0) {
89609
89758
  setConstantValue(node, constantValue);
89610
- const substitute = typeof constantValue === "string" ? factory2.createStringLiteral(constantValue) : constantValue < 0 ? factory2.createPrefixUnaryExpression(41 /* MinusToken */, factory2.createNumericLiteral(Math.abs(constantValue))) : factory2.createNumericLiteral(constantValue);
89759
+ const substitute = typeof constantValue === "string" ? factory2.createStringLiteral(constantValue) : constantValue < 0 ? factory2.createPrefixUnaryExpression(41 /* MinusToken */, factory2.createNumericLiteral(-constantValue)) : factory2.createNumericLiteral(constantValue);
89611
89760
  if (!compilerOptions.removeComments) {
89612
89761
  const originalNode = getOriginalNode(node, isAccessExpression);
89613
89762
  addSyntheticTrailingComment(substitute, 3 /* MultiLineCommentTrivia */, ` ${safeMultiLineComment(getTextOfNode(originalNode))} `);
@@ -103397,7 +103546,7 @@ function transformGenerators(context) {
103397
103546
  if (labelExpressions === void 0) {
103398
103547
  labelExpressions = [];
103399
103548
  }
103400
- const expression = factory2.createNumericLiteral(-1);
103549
+ const expression = factory2.createNumericLiteral(Number.MAX_SAFE_INTEGER);
103401
103550
  if (labelExpressions[label] === void 0) {
103402
103551
  labelExpressions[label] = [expression];
103403
103552
  } else {
@@ -109272,7 +109421,8 @@ function transformDeclarations(context) {
109272
109421
  if (shouldStripInternal(m))
109273
109422
  return;
109274
109423
  const constValue = resolver.getConstantValue(m);
109275
- return preserveJsDoc(factory2.updateEnumMember(m, m.name, constValue !== void 0 ? typeof constValue === "string" ? factory2.createStringLiteral(constValue) : factory2.createNumericLiteral(constValue) : void 0), m);
109424
+ const newInitializer = constValue === void 0 ? void 0 : typeof constValue === "string" ? factory2.createStringLiteral(constValue) : constValue < 0 ? factory2.createPrefixUnaryExpression(41 /* MinusToken */, factory2.createNumericLiteral(-constValue)) : factory2.createNumericLiteral(constValue);
109425
+ return preserveJsDoc(factory2.updateEnumMember(m, m.name, newInitializer), m);
109276
109426
  }))
109277
109427
  ));
109278
109428
  }
@@ -111162,6 +111312,8 @@ function createPrinter(printerOptions = {}, handlers = {}) {
111162
111312
  );
111163
111313
  if (hint === 3 /* MappedTypeParameter */)
111164
111314
  return emitMappedTypeParameter(cast(node, isTypeParameterDeclaration));
111315
+ if (hint === 7 /* ImportTypeNodeAttributes */)
111316
+ return emitImportTypeNodeAttributes(cast(node, isImportAttributes));
111165
111317
  if (hint === 5 /* EmbeddedStatement */) {
111166
111318
  Debug.assertNode(node, isEmptyStatement);
111167
111319
  return emitEmptyStatement(
@@ -112138,15 +112290,7 @@ function createPrinter(printerOptions = {}, handlers = {}) {
112138
112290
  if (node.attributes) {
112139
112291
  writePunctuation(",");
112140
112292
  writeSpace();
112141
- writePunctuation("{");
112142
- writeSpace();
112143
- writeKeyword(node.attributes.token === 132 /* AssertKeyword */ ? "assert" : "with");
112144
- writePunctuation(":");
112145
- writeSpace();
112146
- const elements = node.attributes.elements;
112147
- emitList(node.attributes, elements, 526226 /* ImportAttributes */);
112148
- writeSpace();
112149
- writePunctuation("}");
112293
+ pipelineEmit(7 /* ImportTypeNodeAttributes */, node.attributes);
112150
112294
  }
112151
112295
  writePunctuation(")");
112152
112296
  if (node.qualifier) {
@@ -113208,6 +113352,17 @@ function createPrinter(printerOptions = {}, handlers = {}) {
113208
113352
  }
113209
113353
  writeTrailingSemicolon();
113210
113354
  }
113355
+ function emitImportTypeNodeAttributes(node) {
113356
+ writePunctuation("{");
113357
+ writeSpace();
113358
+ writeKeyword(node.token === 132 /* AssertKeyword */ ? "assert" : "with");
113359
+ writePunctuation(":");
113360
+ writeSpace();
113361
+ const elements = node.elements;
113362
+ emitList(node, elements, 526226 /* ImportAttributes */);
113363
+ writeSpace();
113364
+ writePunctuation("}");
113365
+ }
113211
113366
  function emitImportAttributes(node) {
113212
113367
  emitTokenWithComment(node.token, node.pos, writeKeyword, node);
113213
113368
  writeSpace();