@typescript-deploys/pr-build 4.7.0-pr-48168-8 → 4.7.0-pr-48094-5

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
@@ -69,7 +69,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
69
69
  var ts;
70
70
  (function (ts) {
71
71
  ts.versionMajorMinor = "4.7";
72
- ts.version = ts.versionMajorMinor + ".0-insiders.20220309";
72
+ ts.version = ts.versionMajorMinor + ".0-insiders.20220314";
73
73
  var NativeCollections;
74
74
  (function (NativeCollections) {
75
75
  var globals = typeof globalThis !== "undefined" ? globalThis :
@@ -1270,6 +1270,149 @@ var ts;
1270
1270
  return createMultiMap();
1271
1271
  }
1272
1272
  ts.createUnderscoreEscapedMultiMap = createUnderscoreEscapedMultiMap;
1273
+ function createSet(getHashCode, equals) {
1274
+ var multiMap = new ts.Map();
1275
+ var size = 0;
1276
+ function getElementIterator() {
1277
+ var valueIt = multiMap.values();
1278
+ var arrayIt;
1279
+ return {
1280
+ next: function () {
1281
+ while (true) {
1282
+ if (arrayIt) {
1283
+ var n = arrayIt.next();
1284
+ if (!n.done) {
1285
+ return { value: n.value };
1286
+ }
1287
+ arrayIt = undefined;
1288
+ }
1289
+ else {
1290
+ var n = valueIt.next();
1291
+ if (n.done) {
1292
+ return { value: undefined, done: true };
1293
+ }
1294
+ if (!isArray(n.value)) {
1295
+ return { value: n.value };
1296
+ }
1297
+ arrayIt = arrayIterator(n.value);
1298
+ }
1299
+ }
1300
+ }
1301
+ };
1302
+ }
1303
+ var set = {
1304
+ has: function (element) {
1305
+ var hash = getHashCode(element);
1306
+ if (!multiMap.has(hash))
1307
+ return false;
1308
+ var candidates = multiMap.get(hash);
1309
+ if (!isArray(candidates))
1310
+ return equals(candidates, element);
1311
+ for (var _i = 0, candidates_1 = candidates; _i < candidates_1.length; _i++) {
1312
+ var candidate = candidates_1[_i];
1313
+ if (equals(candidate, element)) {
1314
+ return true;
1315
+ }
1316
+ }
1317
+ return false;
1318
+ },
1319
+ add: function (element) {
1320
+ var hash = getHashCode(element);
1321
+ if (multiMap.has(hash)) {
1322
+ var values = multiMap.get(hash);
1323
+ if (isArray(values)) {
1324
+ if (!contains(values, element, equals)) {
1325
+ values.push(element);
1326
+ size++;
1327
+ }
1328
+ }
1329
+ else {
1330
+ var value = values;
1331
+ if (!equals(value, element)) {
1332
+ multiMap.set(hash, [value, element]);
1333
+ size++;
1334
+ }
1335
+ }
1336
+ }
1337
+ else {
1338
+ multiMap.set(hash, element);
1339
+ size++;
1340
+ }
1341
+ return this;
1342
+ },
1343
+ delete: function (element) {
1344
+ var hash = getHashCode(element);
1345
+ if (!multiMap.has(hash))
1346
+ return false;
1347
+ var candidates = multiMap.get(hash);
1348
+ if (isArray(candidates)) {
1349
+ for (var i = 0; i < candidates.length; i++) {
1350
+ if (equals(candidates[i], element)) {
1351
+ if (candidates.length === 1) {
1352
+ multiMap.delete(hash);
1353
+ }
1354
+ else if (candidates.length === 2) {
1355
+ multiMap.set(hash, candidates[1 - i]);
1356
+ }
1357
+ else {
1358
+ unorderedRemoveItemAt(candidates, i);
1359
+ }
1360
+ size--;
1361
+ return true;
1362
+ }
1363
+ }
1364
+ }
1365
+ else {
1366
+ var candidate = candidates;
1367
+ if (equals(candidate, element)) {
1368
+ multiMap.delete(hash);
1369
+ size--;
1370
+ return true;
1371
+ }
1372
+ }
1373
+ return false;
1374
+ },
1375
+ clear: function () {
1376
+ multiMap.clear();
1377
+ size = 0;
1378
+ },
1379
+ get size() {
1380
+ return size;
1381
+ },
1382
+ forEach: function (action) {
1383
+ for (var _i = 0, _a = arrayFrom(multiMap.values()); _i < _a.length; _i++) {
1384
+ var elements = _a[_i];
1385
+ if (isArray(elements)) {
1386
+ for (var _b = 0, elements_1 = elements; _b < elements_1.length; _b++) {
1387
+ var element = elements_1[_b];
1388
+ action(element, element);
1389
+ }
1390
+ }
1391
+ else {
1392
+ var element = elements;
1393
+ action(element, element);
1394
+ }
1395
+ }
1396
+ },
1397
+ keys: function () {
1398
+ return getElementIterator();
1399
+ },
1400
+ values: function () {
1401
+ return getElementIterator();
1402
+ },
1403
+ entries: function () {
1404
+ var it = getElementIterator();
1405
+ return {
1406
+ next: function () {
1407
+ var n = it.next();
1408
+ return n.done ? n : { value: [n.value, n.value] };
1409
+ }
1410
+ };
1411
+ },
1412
+ };
1413
+ return set;
1414
+ }
1415
+ ts.createSet = createSet;
1273
1416
  function isArray(value) {
1274
1417
  return Array.isArray ? Array.isArray(value) : value instanceof Array;
1275
1418
  }
@@ -1524,8 +1667,8 @@ var ts;
1524
1667
  var maximumLengthDifference = Math.min(2, Math.floor(name.length * 0.34));
1525
1668
  var bestDistance = Math.floor(name.length * 0.4) + 1;
1526
1669
  var bestCandidate;
1527
- for (var _i = 0, candidates_1 = candidates; _i < candidates_1.length; _i++) {
1528
- var candidate = candidates_1[_i];
1670
+ for (var _i = 0, candidates_2 = candidates; _i < candidates_2.length; _i++) {
1671
+ var candidate = candidates_2[_i];
1529
1672
  var candidateName = getName(candidate);
1530
1673
  if (candidateName !== undefined && Math.abs(candidateName.length - name.length) <= maximumLengthDifference) {
1531
1674
  if (candidateName === name) {
@@ -1733,13 +1876,15 @@ var ts;
1733
1876
  for (var _i = 0; _i < arguments.length; _i++) {
1734
1877
  args[_i] = arguments[_i];
1735
1878
  }
1879
+ var lastResult;
1736
1880
  for (var _a = 0, fs_1 = fs; _a < fs_1.length; _a++) {
1737
1881
  var f = fs_1[_a];
1738
- if (f.apply(void 0, args)) {
1739
- return true;
1882
+ lastResult = f.apply(void 0, args);
1883
+ if (lastResult) {
1884
+ return lastResult;
1740
1885
  }
1741
1886
  }
1742
- return false;
1887
+ return lastResult;
1743
1888
  };
1744
1889
  }
1745
1890
  ts.or = or;
@@ -3263,6 +3408,12 @@ var ts;
3263
3408
  ModuleResolutionKind[ModuleResolutionKind["Node12"] = 3] = "Node12";
3264
3409
  ModuleResolutionKind[ModuleResolutionKind["NodeNext"] = 99] = "NodeNext";
3265
3410
  })(ModuleResolutionKind = ts.ModuleResolutionKind || (ts.ModuleResolutionKind = {}));
3411
+ var ModuleDetectionKind;
3412
+ (function (ModuleDetectionKind) {
3413
+ ModuleDetectionKind[ModuleDetectionKind["Legacy"] = 1] = "Legacy";
3414
+ ModuleDetectionKind[ModuleDetectionKind["Auto"] = 2] = "Auto";
3415
+ ModuleDetectionKind[ModuleDetectionKind["Force"] = 3] = "Force";
3416
+ })(ModuleDetectionKind = ts.ModuleDetectionKind || (ts.ModuleDetectionKind = {}));
3266
3417
  var WatchFileKind;
3267
3418
  (function (WatchFileKind) {
3268
3419
  WatchFileKind[WatchFileKind["FixedPollingInterval"] = 0] = "FixedPollingInterval";
@@ -5428,6 +5579,8 @@ var ts;
5428
5579
  catch_or_finally_expected: diag(1472, ts.DiagnosticCategory.Error, "catch_or_finally_expected_1472", "'catch' or 'finally' expected."),
5429
5580
  An_import_declaration_can_only_be_used_at_the_top_level_of_a_module: diag(1473, ts.DiagnosticCategory.Error, "An_import_declaration_can_only_be_used_at_the_top_level_of_a_module_1473", "An import declaration can only be used at the top level of a module."),
5430
5581
  An_export_declaration_can_only_be_used_at_the_top_level_of_a_module: diag(1474, ts.DiagnosticCategory.Error, "An_export_declaration_can_only_be_used_at_the_top_level_of_a_module_1474", "An export declaration can only be used at the top level of a module."),
5582
+ Control_what_method_is_used_to_detect_module_format_JS_files: diag(1475, ts.DiagnosticCategory.Message, "Control_what_method_is_used_to_detect_module_format_JS_files_1475", "Control what method is used to detect module-format JS files."),
5583
+ auto_Colon_Treat_files_with_imports_exports_import_meta_jsx_with_jsx_Colon_react_jsx_or_esm_format_with_module_Colon_node12_as_modules: diag(1476, ts.DiagnosticCategory.Message, "auto_Colon_Treat_files_with_imports_exports_import_meta_jsx_with_jsx_Colon_react_jsx_or_esm_format_w_1476", "\"auto\": Treat files with imports, exports, import.meta, jsx (with jsx: react-jsx), or esm format (with module: node12+) as modules."),
5431
5584
  The_types_of_0_are_incompatible_between_these_types: diag(2200, ts.DiagnosticCategory.Error, "The_types_of_0_are_incompatible_between_these_types_2200", "The types of '{0}' are incompatible between these types."),
5432
5585
  The_types_returned_by_0_are_incompatible_between_these_types: diag(2201, ts.DiagnosticCategory.Error, "The_types_returned_by_0_are_incompatible_between_these_types_2201", "The types returned by '{0}' are incompatible between these types."),
5433
5586
  Call_signature_return_types_0_and_1_are_incompatible: diag(2202, ts.DiagnosticCategory.Error, "Call_signature_return_types_0_and_1_are_incompatible_2202", "Call signature return types '{0}' and '{1}' are incompatible.", undefined, true),
@@ -15604,6 +15757,42 @@ var ts;
15604
15757
  return scriptKind === 4 || scriptKind === 2 || scriptKind === 1 || scriptKind === 6 ? 1 : 0;
15605
15758
  }
15606
15759
  ts.getLanguageVariant = getLanguageVariant;
15760
+ function walkTreeForJSXTags(node) {
15761
+ if (!(node.transformFlags & 2))
15762
+ return undefined;
15763
+ return ts.isJsxOpeningLikeElement(node) || ts.isJsxFragment(node) ? node : ts.forEachChild(node, walkTreeForJSXTags);
15764
+ }
15765
+ function isFileModuleFromUsingJSXTag(file) {
15766
+ return !file.isDeclarationFile ? walkTreeForJSXTags(file) : undefined;
15767
+ }
15768
+ function isFileForcedToBeModuleByFormat(file) {
15769
+ return file.impliedNodeFormat === ts.ModuleKind.ESNext && !file.isDeclarationFile ? true : undefined;
15770
+ }
15771
+ function getSetExternalModuleIndicator(options) {
15772
+ switch (getEmitModuleDetectionKind(options)) {
15773
+ case ts.ModuleDetectionKind.Force:
15774
+ return function (file) {
15775
+ file.externalModuleIndicator = !file.isDeclarationFile || ts.isFileProbablyExternalModule(file);
15776
+ };
15777
+ case ts.ModuleDetectionKind.Legacy:
15778
+ return function (file) {
15779
+ file.externalModuleIndicator = ts.isFileProbablyExternalModule(file);
15780
+ };
15781
+ case ts.ModuleDetectionKind.Auto:
15782
+ var checks = [ts.isFileProbablyExternalModule];
15783
+ if (options.jsx === 4 || options.jsx === 5) {
15784
+ checks.push(isFileModuleFromUsingJSXTag);
15785
+ }
15786
+ var moduleKind = getEmitModuleKind(options);
15787
+ if (moduleKind === ts.ModuleKind.Node12 || moduleKind === ts.ModuleKind.NodeNext) {
15788
+ checks.push(isFileForcedToBeModuleByFormat);
15789
+ }
15790
+ var combined_1 = ts.or.apply(void 0, checks);
15791
+ var callback = function (file) { return void (file.externalModuleIndicator = combined_1(file)); };
15792
+ return callback;
15793
+ }
15794
+ }
15795
+ ts.getSetExternalModuleIndicator = getSetExternalModuleIndicator;
15607
15796
  function getEmitScriptTarget(compilerOptions) {
15608
15797
  return compilerOptions.target ||
15609
15798
  (compilerOptions.module === ts.ModuleKind.Node12 && 7) ||
@@ -15638,6 +15827,10 @@ var ts;
15638
15827
  return moduleResolution;
15639
15828
  }
15640
15829
  ts.getEmitModuleResolutionKind = getEmitModuleResolutionKind;
15830
+ function getEmitModuleDetectionKind(options) {
15831
+ return options.moduleDetection || ts.ModuleDetectionKind.Auto;
15832
+ }
15833
+ ts.getEmitModuleDetectionKind = getEmitModuleDetectionKind;
15641
15834
  function hasJsonModuleEmitEnabled(options) {
15642
15835
  switch (getEmitModuleKind(options)) {
15643
15836
  case ts.ModuleKind.CommonJS:
@@ -24073,6 +24266,32 @@ var ts;
24073
24266
  text.charCodeAt(start + 3) !== 47;
24074
24267
  }
24075
24268
  ts.isJSDocLikeText = isJSDocLikeText;
24269
+ function isFileProbablyExternalModule(sourceFile) {
24270
+ return ts.forEach(sourceFile.statements, isAnExternalModuleIndicatorNode) ||
24271
+ getImportMetaIfNecessary(sourceFile);
24272
+ }
24273
+ ts.isFileProbablyExternalModule = isFileProbablyExternalModule;
24274
+ function isAnExternalModuleIndicatorNode(node) {
24275
+ return hasModifierOfKind(node, 93)
24276
+ || ts.isImportEqualsDeclaration(node) && ts.isExternalModuleReference(node.moduleReference)
24277
+ || ts.isImportDeclaration(node)
24278
+ || ts.isExportAssignment(node)
24279
+ || ts.isExportDeclaration(node) ? node : undefined;
24280
+ }
24281
+ function getImportMetaIfNecessary(sourceFile) {
24282
+ return sourceFile.flags & 2097152 ?
24283
+ walkTreeForImportMeta(sourceFile) :
24284
+ undefined;
24285
+ }
24286
+ function walkTreeForImportMeta(node) {
24287
+ return isImportMeta(node) ? node : forEachChild(node, walkTreeForImportMeta);
24288
+ }
24289
+ function hasModifierOfKind(node, kind) {
24290
+ return ts.some(node.modifiers, function (m) { return m.kind === kind; });
24291
+ }
24292
+ function isImportMeta(node) {
24293
+ return ts.isMetaProperty(node) && node.keywordToken === 100 && node.name.escapedText === "meta";
24294
+ }
24076
24295
  function forEachChild(node, cbNode, cbNodes) {
24077
24296
  if (!node || node.kind <= 159) {
24078
24297
  return;
@@ -24626,17 +24845,25 @@ var ts;
24626
24845
  children.unshift(n);
24627
24846
  }
24628
24847
  }
24629
- function createSourceFile(fileName, sourceText, languageVersion, setParentNodes, scriptKind) {
24848
+ function setExternalModuleIndicator(sourceFile) {
24849
+ sourceFile.externalModuleIndicator = isFileProbablyExternalModule(sourceFile);
24850
+ }
24851
+ function createSourceFile(fileName, sourceText, languageVersionOrOptions, setParentNodes, scriptKind) {
24630
24852
  if (setParentNodes === void 0) { setParentNodes = false; }
24631
24853
  ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.push("parse", "createSourceFile", { path: fileName }, true);
24632
24854
  ts.performance.mark("beforeParse");
24633
24855
  var result;
24634
24856
  ts.perfLogger.logStartParseSourceFile(fileName);
24857
+ var _a = typeof languageVersionOrOptions === "object" ? languageVersionOrOptions : { languageVersion: languageVersionOrOptions }, languageVersion = _a.languageVersion, overrideSetExternalModuleIndicator = _a.setExternalModuleIndicator, format = _a.impliedNodeFormat;
24635
24858
  if (languageVersion === 100) {
24636
- result = Parser.parseSourceFile(fileName, sourceText, languageVersion, undefined, setParentNodes, 6);
24859
+ result = Parser.parseSourceFile(fileName, sourceText, languageVersion, undefined, setParentNodes, 6, ts.noop);
24637
24860
  }
24638
24861
  else {
24639
- result = Parser.parseSourceFile(fileName, sourceText, languageVersion, undefined, setParentNodes, scriptKind);
24862
+ var setIndicator = format === undefined ? overrideSetExternalModuleIndicator : function (file) {
24863
+ file.impliedNodeFormat = format;
24864
+ return (overrideSetExternalModuleIndicator || setExternalModuleIndicator)(file);
24865
+ };
24866
+ result = Parser.parseSourceFile(fileName, sourceText, languageVersion, undefined, setParentNodes, scriptKind, setIndicator);
24640
24867
  }
24641
24868
  ts.perfLogger.logStopParseSourceFile();
24642
24869
  ts.performance.mark("afterParse");
@@ -24716,7 +24943,7 @@ var ts;
24716
24943
  var contextFlags;
24717
24944
  var topLevel = true;
24718
24945
  var parseErrorBeforeNextFinishedNode = false;
24719
- function parseSourceFile(fileName, sourceText, languageVersion, syntaxCursor, setParentNodes, scriptKind) {
24946
+ function parseSourceFile(fileName, sourceText, languageVersion, syntaxCursor, setParentNodes, scriptKind, setExternalModuleIndicatorOverride) {
24720
24947
  var _a;
24721
24948
  if (setParentNodes === void 0) { setParentNodes = false; }
24722
24949
  scriptKind = ts.ensureScriptKind(fileName, scriptKind);
@@ -24732,7 +24959,7 @@ var ts;
24732
24959
  return result_3;
24733
24960
  }
24734
24961
  initializeState(fileName, sourceText, languageVersion, syntaxCursor, scriptKind);
24735
- var result = parseSourceFileWorker(languageVersion, setParentNodes, scriptKind);
24962
+ var result = parseSourceFileWorker(languageVersion, setParentNodes, scriptKind, setExternalModuleIndicatorOverride || setExternalModuleIndicator);
24736
24963
  clearState();
24737
24964
  return result;
24738
24965
  }
@@ -24808,7 +25035,7 @@ var ts;
24808
25035
  statements = createNodeArray([statement], pos);
24809
25036
  endOfFileToken = parseExpectedToken(1, ts.Diagnostics.Unexpected_token);
24810
25037
  }
24811
- var sourceFile = createSourceFile(fileName, 2, 6, false, statements, endOfFileToken, sourceFlags);
25038
+ var sourceFile = createSourceFile(fileName, 2, 6, false, statements, endOfFileToken, sourceFlags, ts.noop);
24812
25039
  if (setParentNodes) {
24813
25040
  fixupParentReferences(sourceFile);
24814
25041
  }
@@ -24879,7 +25106,7 @@ var ts;
24879
25106
  notParenthesizedArrow = undefined;
24880
25107
  topLevel = true;
24881
25108
  }
24882
- function parseSourceFileWorker(languageVersion, setParentNodes, scriptKind) {
25109
+ function parseSourceFileWorker(languageVersion, setParentNodes, scriptKind, setExternalModuleIndicator) {
24883
25110
  var isDeclarationFile = isDeclarationFileName(fileName);
24884
25111
  if (isDeclarationFile) {
24885
25112
  contextFlags |= 8388608;
@@ -24889,7 +25116,7 @@ var ts;
24889
25116
  var statements = parseList(0, parseStatement);
24890
25117
  ts.Debug.assert(token() === 1);
24891
25118
  var endOfFileToken = addJSDocComment(parseTokenNode());
24892
- var sourceFile = createSourceFile(fileName, languageVersion, scriptKind, isDeclarationFile, statements, endOfFileToken, sourceFlags);
25119
+ var sourceFile = createSourceFile(fileName, languageVersion, scriptKind, isDeclarationFile, statements, endOfFileToken, sourceFlags, setExternalModuleIndicator);
24893
25120
  processCommentPragmas(sourceFile, sourceText);
24894
25121
  processPragmasIntoFields(sourceFile, reportPragmaDiagnostic);
24895
25122
  sourceFile.commentDirectives = scanner.getCommentDirectives();
@@ -25013,22 +25240,27 @@ var ts;
25013
25240
  ts.setParentRecursive(rootNode, true);
25014
25241
  }
25015
25242
  Parser.fixupParentReferences = fixupParentReferences;
25016
- function createSourceFile(fileName, languageVersion, scriptKind, isDeclarationFile, statements, endOfFileToken, flags) {
25243
+ function createSourceFile(fileName, languageVersion, scriptKind, isDeclarationFile, statements, endOfFileToken, flags, setExternalModuleIndicator) {
25017
25244
  var sourceFile = factory.createSourceFile(statements, endOfFileToken, flags);
25018
25245
  ts.setTextRangePosWidth(sourceFile, 0, sourceText.length);
25019
- setExternalModuleIndicator(sourceFile);
25246
+ setFields(sourceFile);
25020
25247
  if (!isDeclarationFile && isExternalModule(sourceFile) && sourceFile.transformFlags & 16777216) {
25021
25248
  sourceFile = reparseTopLevelAwait(sourceFile);
25249
+ setFields(sourceFile);
25022
25250
  }
25023
- sourceFile.text = sourceText;
25024
- sourceFile.bindDiagnostics = [];
25025
- sourceFile.bindSuggestionDiagnostics = undefined;
25026
- sourceFile.languageVersion = languageVersion;
25027
- sourceFile.fileName = fileName;
25028
- sourceFile.languageVariant = ts.getLanguageVariant(scriptKind);
25029
- sourceFile.isDeclarationFile = isDeclarationFile;
25030
- sourceFile.scriptKind = scriptKind;
25031
25251
  return sourceFile;
25252
+ function setFields(sourceFile) {
25253
+ sourceFile.text = sourceText;
25254
+ sourceFile.bindDiagnostics = [];
25255
+ sourceFile.bindSuggestionDiagnostics = undefined;
25256
+ sourceFile.languageVersion = languageVersion;
25257
+ sourceFile.fileName = fileName;
25258
+ sourceFile.languageVariant = ts.getLanguageVariant(scriptKind);
25259
+ sourceFile.isDeclarationFile = isDeclarationFile;
25260
+ sourceFile.scriptKind = scriptKind;
25261
+ setExternalModuleIndicator(sourceFile);
25262
+ sourceFile.setExternalModuleIndicator = setExternalModuleIndicator;
25263
+ }
25032
25264
  }
25033
25265
  function setContextFlag(val, flag) {
25034
25266
  if (val) {
@@ -29473,32 +29705,6 @@ var ts;
29473
29705
  var node = factory.createExportAssignment(decorators, modifiers, isExportEquals, expression);
29474
29706
  return withJSDoc(finishNode(node, pos), hasJSDoc);
29475
29707
  }
29476
- function setExternalModuleIndicator(sourceFile) {
29477
- sourceFile.externalModuleIndicator =
29478
- ts.forEach(sourceFile.statements, isAnExternalModuleIndicatorNode) ||
29479
- getImportMetaIfNecessary(sourceFile);
29480
- }
29481
- function isAnExternalModuleIndicatorNode(node) {
29482
- return hasModifierOfKind(node, 93)
29483
- || ts.isImportEqualsDeclaration(node) && ts.isExternalModuleReference(node.moduleReference)
29484
- || ts.isImportDeclaration(node)
29485
- || ts.isExportAssignment(node)
29486
- || ts.isExportDeclaration(node) ? node : undefined;
29487
- }
29488
- function getImportMetaIfNecessary(sourceFile) {
29489
- return sourceFile.flags & 2097152 ?
29490
- walkTreeForExternalModuleIndicators(sourceFile) :
29491
- undefined;
29492
- }
29493
- function walkTreeForExternalModuleIndicators(node) {
29494
- return isImportMeta(node) ? node : forEachChild(node, walkTreeForExternalModuleIndicators);
29495
- }
29496
- function hasModifierOfKind(node, kind) {
29497
- return ts.some(node.modifiers, function (m) { return m.kind === kind; });
29498
- }
29499
- function isImportMeta(node) {
29500
- return ts.isMetaProperty(node) && node.keywordToken === 100 && node.name.escapedText === "meta";
29501
- }
29502
29708
  var JSDocParser;
29503
29709
  (function (JSDocParser) {
29504
29710
  function parseJSDocTypeExpressionForTests(content, start, length) {
@@ -29506,7 +29712,7 @@ var ts;
29506
29712
  scanner.setText(content, start, length);
29507
29713
  currentToken = scanner.scan();
29508
29714
  var jsDocTypeExpression = parseJSDocTypeExpression();
29509
- var sourceFile = createSourceFile("file.js", 99, 1, false, [], factory.createToken(1), 0);
29715
+ var sourceFile = createSourceFile("file.js", 99, 1, false, [], factory.createToken(1), 0, ts.noop);
29510
29716
  var diagnostics = ts.attachFileToDiagnostics(parseDiagnostics, sourceFile);
29511
29717
  if (jsDocDiagnostics) {
29512
29718
  sourceFile.jsDocDiagnostics = ts.attachFileToDiagnostics(jsDocDiagnostics, sourceFile);
@@ -30402,7 +30608,7 @@ var ts;
30402
30608
  return sourceFile;
30403
30609
  }
30404
30610
  if (sourceFile.statements.length === 0) {
30405
- return Parser.parseSourceFile(sourceFile.fileName, newText, sourceFile.languageVersion, undefined, true, sourceFile.scriptKind);
30611
+ return Parser.parseSourceFile(sourceFile.fileName, newText, sourceFile.languageVersion, undefined, true, sourceFile.scriptKind, sourceFile.setExternalModuleIndicator);
30406
30612
  }
30407
30613
  var incrementalSourceFile = sourceFile;
30408
30614
  ts.Debug.assert(!incrementalSourceFile.hasBeenIncrementallyParsed);
@@ -30417,7 +30623,7 @@ var ts;
30417
30623
  ts.Debug.assert(ts.textSpanEnd(ts.textChangeRangeNewSpan(changeRange)) === ts.textSpanEnd(ts.textChangeRangeNewSpan(textChangeRange)));
30418
30624
  var delta = ts.textChangeRangeNewSpan(changeRange).length - changeRange.span.length;
30419
30625
  updateTokenPositionsAndMarkElements(incrementalSourceFile, changeRange.span.start, ts.textSpanEnd(changeRange.span), ts.textSpanEnd(ts.textChangeRangeNewSpan(changeRange)), delta, oldText, newText, aggressiveChecks);
30420
- var result = Parser.parseSourceFile(sourceFile.fileName, newText, sourceFile.languageVersion, syntaxCursor, true, sourceFile.scriptKind);
30626
+ var result = Parser.parseSourceFile(sourceFile.fileName, newText, sourceFile.languageVersion, syntaxCursor, true, sourceFile.scriptKind, sourceFile.setExternalModuleIndicator);
30421
30627
  result.commentDirectives = getNewCommentDirectives(sourceFile.commentDirectives, result.commentDirectives, changeRange.span.start, ts.textSpanEnd(changeRange.span), delta, oldText, newText, aggressiveChecks);
30422
30628
  result.impliedNodeFormat = sourceFile.impliedNodeFormat;
30423
30629
  return result;
@@ -32129,6 +32335,18 @@ var ts;
32129
32335
  description: ts.Diagnostics.Specify_a_list_of_language_service_plugins_to_include,
32130
32336
  category: ts.Diagnostics.Editor_Support,
32131
32337
  },
32338
+ {
32339
+ name: "moduleDetection",
32340
+ type: new ts.Map(ts.getEntries({
32341
+ auto: ts.ModuleDetectionKind.Auto,
32342
+ legacy: ts.ModuleDetectionKind.Legacy,
32343
+ force: ts.ModuleDetectionKind.Force,
32344
+ })),
32345
+ affectsModuleResolution: true,
32346
+ description: ts.Diagnostics.Control_what_method_is_used_to_detect_module_format_JS_files,
32347
+ category: ts.Diagnostics.Language_and_Environment,
32348
+ defaultValueDescription: ts.Diagnostics.auto_Colon_Treat_files_with_imports_exports_import_meta_jsx_with_jsx_Colon_react_jsx_or_esm_format_with_module_Colon_node12_as_modules,
32349
+ }
32132
32350
  ];
32133
32351
  ts.optionDeclarations = __spreadArray(__spreadArray([], ts.commonOptionsWithBuild, true), commandOptionsWithoutBuild, true);
32134
32352
  ts.semanticDiagnosticsOptionDeclarations = ts.optionDeclarations.filter(function (option) { return !!option.affectsSemanticDiagnostics; });
@@ -36410,7 +36628,6 @@ var ts;
36410
36628
  node = node.parent;
36411
36629
  }
36412
36630
  return !isStatementCondition(node) &&
36413
- !isLogicalAssignmentExpression(node.parent) &&
36414
36631
  !isLogicalExpression(node.parent) &&
36415
36632
  !(ts.isOptionalChain(node.parent) && node.parent.expression === node);
36416
36633
  }
@@ -38171,7 +38388,7 @@ var ts;
38171
38388
  checkStrictModeEvalOrArguments(node, node.name);
38172
38389
  }
38173
38390
  if (!ts.isBindingPattern(node.name)) {
38174
- if (ts.isInJSFile(node) && ts.isVariableDeclarationInitializedToBareOrAccessedRequire(node) && !ts.getJSDocTypeTag(node)) {
38391
+ if (ts.isInJSFile(node) && ts.isVariableDeclarationInitializedToBareOrAccessedRequire(node) && !ts.getJSDocTypeTag(node) && !(ts.getCombinedModifierFlags(node) & 1)) {
38175
38392
  declareSymbolAndAddToSymbolTable(node, 2097152, 2097152);
38176
38393
  }
38177
38394
  else if (ts.isBlockOrCatchScoped(node)) {
@@ -52874,7 +53091,7 @@ var ts;
52874
53091
  return true;
52875
53092
  }
52876
53093
  }
52877
- else {
53094
+ else if (!((source.flags | target.flags) & (3145728 | 8388608 | 16777216 | 33554432))) {
52878
53095
  if (source.flags !== target.flags)
52879
53096
  return false;
52880
53097
  if (source.flags & 67358815)
@@ -56004,17 +56221,27 @@ var ts;
56004
56221
  return sourceStart.slice(0, startLen) !== targetStart.slice(0, startLen) ||
56005
56222
  sourceEnd.slice(sourceEnd.length - endLen) !== targetEnd.slice(targetEnd.length - endLen);
56006
56223
  }
56007
- function isValidBigIntString(s) {
56224
+ function isValidNumberString(s, roundTripOnly) {
56225
+ if (s === "")
56226
+ return false;
56227
+ var n = +s;
56228
+ return isFinite(n) && (!roundTripOnly || "" + n === s);
56229
+ }
56230
+ function isValidBigIntString(s, roundTripOnly) {
56231
+ if (s === "")
56232
+ return false;
56008
56233
  var scanner = ts.createScanner(99, false);
56009
56234
  var success = true;
56010
56235
  scanner.setOnError(function () { return success = false; });
56011
56236
  scanner.setText(s + "n");
56012
56237
  var result = scanner.scan();
56013
- if (result === 40) {
56238
+ var negative = result === 40;
56239
+ if (negative) {
56014
56240
  result = scanner.scan();
56015
56241
  }
56016
56242
  var flags = scanner.getTokenFlags();
56017
- return success && result === 9 && scanner.getTextPos() === (s.length + 1) && !(flags & 512);
56243
+ return success && result === 9 && scanner.getTextPos() === (s.length + 1) && !(flags & 512)
56244
+ && (!roundTripOnly || s === ts.pseudoBigIntToString({ negative: negative, base10Value: ts.parsePseudoBigInt(scanner.getTokenValue()) }));
56018
56245
  }
56019
56246
  function isValidTypeForTemplateLiteralPlaceholder(source, target) {
56020
56247
  if (source === target || target.flags & (1 | 4)) {
@@ -56022,8 +56249,8 @@ var ts;
56022
56249
  }
56023
56250
  if (source.flags & 128) {
56024
56251
  var value = source.value;
56025
- return !!(target.flags & 8 && value !== "" && isFinite(+value) ||
56026
- target.flags & 64 && value !== "" && isValidBigIntString(value) ||
56252
+ return !!(target.flags & 8 && isValidNumberString(value, false) ||
56253
+ target.flags & 64 && isValidBigIntString(value, false) ||
56027
56254
  target.flags & (512 | 98304) && value === target.intrinsicName);
56028
56255
  }
56029
56256
  if (source.flags & 134217728) {
@@ -56489,7 +56716,61 @@ var ts;
56489
56716
  var types = target.types;
56490
56717
  if (matches || ts.every(target.texts, function (s) { return s.length === 0; })) {
56491
56718
  for (var i = 0; i < types.length; i++) {
56492
- inferFromTypes(matches ? matches[i] : neverType, types[i]);
56719
+ var source_1 = matches ? matches[i] : neverType;
56720
+ var target_3 = types[i];
56721
+ var sourceTypes = void 0;
56722
+ if (source_1.flags & 128 && target_3.flags & 8650752) {
56723
+ var inferenceContext = getInferenceInfoForType(target_3);
56724
+ var constraint = inferenceContext ? getConstraintOfTypeParameter(inferenceContext.typeParameter) : undefined;
56725
+ if (inferenceContext && constraint) {
56726
+ var str = source_1.value;
56727
+ var constraintTypes = constraint.flags & 1048576 ? constraint.types : [constraint];
56728
+ for (var _i = 0, constraintTypes_1 = constraintTypes; _i < constraintTypes_1.length; _i++) {
56729
+ var constraintType = constraintTypes_1[_i];
56730
+ if (constraintType.flags & 402653316) {
56731
+ sourceTypes !== null && sourceTypes !== void 0 ? sourceTypes : (sourceTypes = []);
56732
+ sourceTypes.push(source_1);
56733
+ }
56734
+ if (constraintType.flags & 296 && isValidNumberString(str, true)) {
56735
+ sourceTypes !== null && sourceTypes !== void 0 ? sourceTypes : (sourceTypes = []);
56736
+ sourceTypes.push(getNumberLiteralType(+str));
56737
+ }
56738
+ if (constraintType.flags & 2112 && isValidBigIntString(str, true)) {
56739
+ var negative = str.startsWith("-");
56740
+ var base10Value = ts.parsePseudoBigInt((negative ? str.slice(1) : str) + "n");
56741
+ sourceTypes !== null && sourceTypes !== void 0 ? sourceTypes : (sourceTypes = []);
56742
+ sourceTypes.push(getBigIntLiteralType({ negative: negative, base10Value: base10Value }));
56743
+ }
56744
+ if (constraintType.flags & 528) {
56745
+ if (str === trueType.intrinsicName) {
56746
+ sourceTypes !== null && sourceTypes !== void 0 ? sourceTypes : (sourceTypes = []);
56747
+ sourceTypes.push(trueType);
56748
+ }
56749
+ else if (str === falseType.intrinsicName) {
56750
+ sourceTypes !== null && sourceTypes !== void 0 ? sourceTypes : (sourceTypes = []);
56751
+ sourceTypes.push(falseType);
56752
+ }
56753
+ }
56754
+ if (constraintType.flags & 65536 && str === nullType.intrinsicName) {
56755
+ sourceTypes !== null && sourceTypes !== void 0 ? sourceTypes : (sourceTypes = []);
56756
+ sourceTypes.push(nullType);
56757
+ }
56758
+ if (constraintType.flags & 32768 && str === undefinedType.intrinsicName) {
56759
+ sourceTypes !== null && sourceTypes !== void 0 ? sourceTypes : (sourceTypes = []);
56760
+ sourceTypes.push(undefinedType);
56761
+ }
56762
+ }
56763
+ }
56764
+ }
56765
+ if (sourceTypes) {
56766
+ for (var _a = 0, sourceTypes_3 = sourceTypes; _a < sourceTypes_3.length; _a++) {
56767
+ var source_2 = sourceTypes_3[_a];
56768
+ inferFromTypes(source_2, target_3);
56769
+ }
56770
+ }
56771
+ else {
56772
+ inferFromTypes(source_1, target_3);
56773
+ }
56493
56774
  }
56494
56775
  }
56495
56776
  }
@@ -58120,7 +58401,7 @@ var ts;
58120
58401
  return result;
58121
58402
  }
58122
58403
  function getCandidateDiscriminantPropertyAccess(expr) {
58123
- if (ts.isBindingPattern(reference) || ts.isFunctionExpressionOrArrowFunction(reference)) {
58404
+ if (ts.isBindingPattern(reference) || ts.isFunctionExpressionOrArrowFunction(reference) || ts.isObjectLiteralMethod(reference)) {
58124
58405
  if (ts.isIdentifier(expr)) {
58125
58406
  var symbol = getResolvedSymbol(expr);
58126
58407
  var declaration = symbol.valueDeclaration;
@@ -64044,6 +64325,9 @@ var ts;
64044
64325
  assignBindingElementTypes(declaration.name, links.type);
64045
64326
  }
64046
64327
  }
64328
+ else if (type) {
64329
+ ts.Debug.assertEqual(links.type, type, "Parameter symbol already has a cached type which differs from newly assigned type");
64330
+ }
64047
64331
  }
64048
64332
  function assignBindingElementTypes(pattern, parentType) {
64049
64333
  for (var _i = 0, _a = pattern.elements; _i < _a.length; _i++) {
@@ -73530,8 +73814,8 @@ var ts;
73530
73814
  }
73531
73815
  else {
73532
73816
  var elements = name.elements;
73533
- for (var _i = 0, elements_1 = elements; _i < elements_1.length; _i++) {
73534
- var element = elements_1[_i];
73817
+ for (var _i = 0, elements_2 = elements; _i < elements_2.length; _i++) {
73818
+ var element = elements_2[_i];
73535
73819
  if (!ts.isOmittedExpression(element)) {
73536
73820
  return checkESModuleMarker(element.name);
73537
73821
  }
@@ -73547,8 +73831,8 @@ var ts;
73547
73831
  }
73548
73832
  else {
73549
73833
  var elements = name.elements;
73550
- for (var _i = 0, elements_2 = elements; _i < elements_2.length; _i++) {
73551
- var element = elements_2[_i];
73834
+ for (var _i = 0, elements_3 = elements; _i < elements_3.length; _i++) {
73835
+ var element = elements_3[_i];
73552
73836
  if (!ts.isOmittedExpression(element)) {
73553
73837
  checkGrammarNameInLetOrConstDeclarations(element.name);
73554
73838
  }
@@ -75566,8 +75850,8 @@ var ts;
75566
75850
  }
75567
75851
  function bindingOrAssignmentPatternAssignsToName(pattern, escapedName) {
75568
75852
  var elements = ts.getElementsOfBindingOrAssignmentPattern(pattern);
75569
- for (var _i = 0, elements_3 = elements; _i < elements_3.length; _i++) {
75570
- var element = elements_3[_i];
75853
+ for (var _i = 0, elements_4 = elements; _i < elements_4.length; _i++) {
75854
+ var element = elements_4[_i];
75571
75855
  if (bindingOrAssignmentElementAssignsToName(element, escapedName)) {
75572
75856
  return true;
75573
75857
  }
@@ -79608,8 +79892,8 @@ var ts;
79608
79892
  function chunkObjectLiteralElements(elements) {
79609
79893
  var chunkObject;
79610
79894
  var objects = [];
79611
- for (var _i = 0, elements_4 = elements; _i < elements_4.length; _i++) {
79612
- var e = elements_4[_i];
79895
+ for (var _i = 0, elements_5 = elements; _i < elements_5.length; _i++) {
79896
+ var e = elements_5[_i];
79613
79897
  if (e.kind === 297) {
79614
79898
  if (chunkObject) {
79615
79899
  objects.push(factory.createObjectLiteralExpression(chunkObject));
@@ -94284,7 +94568,7 @@ var ts;
94284
94568
  var existingDirectories = new ts.Map();
94285
94569
  var getCanonicalFileName = ts.createGetCanonicalFileName(system.useCaseSensitiveFileNames);
94286
94570
  var computeHash = ts.maybeBind(system, system.createHash) || ts.generateDjb2Hash;
94287
- function getSourceFile(fileName, languageVersion, onError) {
94571
+ function getSourceFile(fileName, languageVersionOrOptions, onError) {
94288
94572
  var text;
94289
94573
  try {
94290
94574
  ts.performance.mark("beforeIORead");
@@ -94298,7 +94582,7 @@ var ts;
94298
94582
  }
94299
94583
  text = "";
94300
94584
  }
94301
- return text !== undefined ? ts.createSourceFile(fileName, text, languageVersion, setParentNodes) : undefined;
94585
+ return text !== undefined ? ts.createSourceFile(fileName, text, languageVersionOrOptions, setParentNodes) : undefined;
94302
94586
  }
94303
94587
  function directoryExists(directoryPath) {
94304
94588
  if (existingDirectories.has(directoryPath)) {
@@ -95519,8 +95803,8 @@ var ts;
95519
95803
  for (var _i = 0, oldSourceFiles_2 = oldSourceFiles; _i < oldSourceFiles_2.length; _i++) {
95520
95804
  var oldSourceFile = oldSourceFiles_2[_i];
95521
95805
  var newSourceFile = host.getSourceFileByPath
95522
- ? host.getSourceFileByPath(oldSourceFile.fileName, oldSourceFile.resolvedPath, ts.getEmitScriptTarget(options), undefined, shouldCreateNewSourceFile)
95523
- : host.getSourceFile(oldSourceFile.fileName, ts.getEmitScriptTarget(options), undefined, shouldCreateNewSourceFile);
95806
+ ? host.getSourceFileByPath(oldSourceFile.fileName, oldSourceFile.resolvedPath, getCreateSourceFileOptions(oldSourceFile.fileName, moduleResolutionCache, host, options), undefined, shouldCreateNewSourceFile)
95807
+ : host.getSourceFile(oldSourceFile.fileName, getCreateSourceFileOptions(oldSourceFile.fileName, moduleResolutionCache, host, options), undefined, shouldCreateNewSourceFile);
95524
95808
  if (!newSourceFile) {
95525
95809
  return 0;
95526
95810
  }
@@ -95546,7 +95830,6 @@ var ts;
95546
95830
  newSourceFile.originalFileName = oldSourceFile.originalFileName;
95547
95831
  newSourceFile.resolvedPath = oldSourceFile.resolvedPath;
95548
95832
  newSourceFile.fileName = oldSourceFile.fileName;
95549
- newSourceFile.impliedNodeFormat = oldSourceFile.impliedNodeFormat;
95550
95833
  var packageName = oldProgram.sourceFileToPackageName.get(oldSourceFile.path);
95551
95834
  if (packageName !== undefined) {
95552
95835
  var prevKind = seenPackageNames.get(packageName);
@@ -96353,6 +96636,14 @@ var ts;
96353
96636
  ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.pop();
96354
96637
  return result;
96355
96638
  }
96639
+ function getCreateSourceFileOptions(fileName, moduleResolutionCache, host, options) {
96640
+ var impliedNodeFormat = getImpliedNodeFormatForFile(toPath(fileName), moduleResolutionCache === null || moduleResolutionCache === void 0 ? void 0 : moduleResolutionCache.getPackageJsonInfoCache(), host, options);
96641
+ return {
96642
+ languageVersion: ts.getEmitScriptTarget(options),
96643
+ impliedNodeFormat: impliedNodeFormat,
96644
+ setExternalModuleIndicator: ts.getSetExternalModuleIndicator(options)
96645
+ };
96646
+ }
96356
96647
  function findSourceFileWorker(fileName, isDefaultLib, ignoreNoDefaultLib, reason, packageId) {
96357
96648
  var path = toPath(fileName);
96358
96649
  if (useSourceOfProjectReferenceRedirect) {
@@ -96423,7 +96714,7 @@ var ts;
96423
96714
  redirectedPath = toPath(redirect);
96424
96715
  }
96425
96716
  }
96426
- var file = host.getSourceFile(fileName, ts.getEmitScriptTarget(options), function (hostErrorMessage) { return addFilePreprocessingFileExplainingDiagnostic(undefined, reason, ts.Diagnostics.Cannot_read_file_0_Colon_1, [fileName, hostErrorMessage]); }, shouldCreateNewSourceFile);
96717
+ var file = host.getSourceFile(fileName, getCreateSourceFileOptions(fileName, moduleResolutionCache, host, options), function (hostErrorMessage) { return addFilePreprocessingFileExplainingDiagnostic(undefined, reason, ts.Diagnostics.Cannot_read_file_0_Colon_1, [fileName, hostErrorMessage]); }, shouldCreateNewSourceFile);
96427
96718
  if (packageId) {
96428
96719
  var packageIdKey = ts.packageIdToString(packageId);
96429
96720
  var fileFromPackageId = packageIdToSourceFile.get(packageIdKey);
@@ -96448,7 +96739,6 @@ var ts;
96448
96739
  file.path = path;
96449
96740
  file.resolvedPath = toPath(fileName);
96450
96741
  file.originalFileName = originalFileName;
96451
- file.impliedNodeFormat = getImpliedNodeFormatForFile(file.resolvedPath, moduleResolutionCache === null || moduleResolutionCache === void 0 ? void 0 : moduleResolutionCache.getPackageJsonInfoCache(), host, options);
96452
96742
  addFileIncludeReason(file, reason);
96453
96743
  if (host.useCaseSensitiveFileNames()) {
96454
96744
  var pathLowerCase = ts.toFileNameLowerCase(path);
@@ -96909,7 +97199,7 @@ var ts;
96909
97199
  }
96910
97200
  }
96911
97201
  else if (firstNonAmbientExternalModuleSourceFile && languageVersion < 2 && options.module === ts.ModuleKind.None) {
96912
- var span = ts.getErrorSpanForNode(firstNonAmbientExternalModuleSourceFile, firstNonAmbientExternalModuleSourceFile.externalModuleIndicator);
97202
+ var span = ts.getErrorSpanForNode(firstNonAmbientExternalModuleSourceFile, typeof firstNonAmbientExternalModuleSourceFile.externalModuleIndicator === "boolean" ? firstNonAmbientExternalModuleSourceFile : firstNonAmbientExternalModuleSourceFile.externalModuleIndicator);
96913
97203
  programDiagnostics.add(ts.createFileDiagnostic(firstNonAmbientExternalModuleSourceFile, span.start, span.length, ts.Diagnostics.Cannot_use_imports_exports_or_module_augmentations_when_module_is_none));
96914
97204
  }
96915
97205
  if (outputFile && !options.emitDeclarationOnly) {
@@ -96917,7 +97207,7 @@ var ts;
96917
97207
  createDiagnosticForOptionName(ts.Diagnostics.Only_amd_and_system_modules_are_supported_alongside_0, options.out ? "out" : "outFile", "module");
96918
97208
  }
96919
97209
  else if (options.module === undefined && firstNonAmbientExternalModuleSourceFile) {
96920
- var span = ts.getErrorSpanForNode(firstNonAmbientExternalModuleSourceFile, firstNonAmbientExternalModuleSourceFile.externalModuleIndicator);
97210
+ var span = ts.getErrorSpanForNode(firstNonAmbientExternalModuleSourceFile, typeof firstNonAmbientExternalModuleSourceFile.externalModuleIndicator === "boolean" ? firstNonAmbientExternalModuleSourceFile : firstNonAmbientExternalModuleSourceFile.externalModuleIndicator);
96921
97211
  programDiagnostics.add(ts.createFileDiagnostic(firstNonAmbientExternalModuleSourceFile, span.start, span.length, ts.Diagnostics.Cannot_compile_modules_using_option_0_unless_the_module_flag_is_amd_or_system, options.out ? "out" : "outFile"));
96922
97212
  }
96923
97213
  }
@@ -100581,7 +100871,7 @@ var ts;
100581
100871
  var useCaseSensitiveFileNames = host.useCaseSensitiveFileNames();
100582
100872
  var hostGetNewLine = ts.memoize(function () { return host.getNewLine(); });
100583
100873
  return {
100584
- getSourceFile: function (fileName, languageVersion, onError) {
100874
+ getSourceFile: function (fileName, languageVersionOrOptions, onError) {
100585
100875
  var text;
100586
100876
  try {
100587
100877
  ts.performance.mark("beforeIORead");
@@ -100595,7 +100885,7 @@ var ts;
100595
100885
  }
100596
100886
  text = "";
100597
100887
  }
100598
- return text !== undefined ? ts.createSourceFile(fileName, text, languageVersion) : undefined;
100888
+ return text !== undefined ? ts.createSourceFile(fileName, text, languageVersionOrOptions) : undefined;
100599
100889
  },
100600
100890
  getDefaultLibLocation: ts.maybeBind(host, host.getDefaultLibLocation),
100601
100891
  getDefaultLibFileName: function (options) { return host.getDefaultLibFileName(options); },
@@ -101026,13 +101316,13 @@ var ts;
101026
101316
  }
101027
101317
  return directoryStructureHost.fileExists(fileName);
101028
101318
  }
101029
- function getVersionedSourceFileByPath(fileName, path, languageVersion, onError, shouldCreateNewSourceFile) {
101319
+ function getVersionedSourceFileByPath(fileName, path, languageVersionOrOptions, onError, shouldCreateNewSourceFile) {
101030
101320
  var hostSourceFile = sourceFilesCache.get(path);
101031
101321
  if (isFileMissingOnHost(hostSourceFile)) {
101032
101322
  return undefined;
101033
101323
  }
101034
101324
  if (hostSourceFile === undefined || shouldCreateNewSourceFile || isFilePresenceUnknownOnHost(hostSourceFile)) {
101035
- var sourceFile = getNewSourceFile(fileName, languageVersion, onError);
101325
+ var sourceFile = getNewSourceFile(fileName, languageVersionOrOptions, onError);
101036
101326
  if (hostSourceFile) {
101037
101327
  if (sourceFile) {
101038
101328
  hostSourceFile.sourceFile = sourceFile;