@typescript-deploys/pr-build 5.4.0-pr-56392-10 → 5.4.0-pr-56878-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 CHANGED
@@ -45010,11 +45010,7 @@ function createTypeChecker(host) {
45010
45010
  if (errorBindingElement) {
45011
45011
  return findAncestor(errorBindingElement, isBindingElement) !== findAncestor(declaration, isBindingElement) || declaration.pos < errorBindingElement.pos;
45012
45012
  }
45013
- const rootDeclaration = getRootDeclaration(declaration);
45014
- if (rootDeclaration.kind !== 260 /* VariableDeclaration */) {
45015
- return true;
45016
- }
45017
- return isBlockScopedNameDeclaredBeforeUse(rootDeclaration, usage);
45013
+ return isBlockScopedNameDeclaredBeforeUse(getAncestor(declaration, 260 /* VariableDeclaration */), usage);
45018
45014
  } else if (declaration.kind === 260 /* VariableDeclaration */) {
45019
45015
  return !isImmediatelyUsedInInitializerOfBlockScopedVariable(declaration, usage);
45020
45016
  } else if (isClassLike(declaration)) {
@@ -65339,9 +65335,29 @@ function createTypeChecker(host) {
65339
65335
  /*ignoreErrors*/
65340
65336
  true
65341
65337
  );
65342
- if (!symbol || symbol.valueDeclaration && !isBlockScopedNameDeclaredBeforeUse(symbol.valueDeclaration, node))
65338
+ if (!symbol || !(isConstantVariable(symbol) || symbol.flags & 8 /* EnumMember */))
65343
65339
  return void 0;
65344
- return tryGetNameFromType(getTypeOfExpression(node));
65340
+ const declaration = symbol.valueDeclaration;
65341
+ if (declaration === void 0)
65342
+ return void 0;
65343
+ const type = tryGetTypeFromEffectiveTypeNode(declaration);
65344
+ if (type) {
65345
+ const name = tryGetNameFromType(type);
65346
+ if (name !== void 0) {
65347
+ return name;
65348
+ }
65349
+ }
65350
+ if (hasOnlyExpressionInitializer(declaration) && isBlockScopedNameDeclaredBeforeUse(declaration, node)) {
65351
+ const initializer = getEffectiveInitializer(declaration);
65352
+ if (initializer) {
65353
+ const initializerType = isBindingPattern(declaration.parent) ? getTypeForBindingElement(declaration) : getTypeOfExpression(initializer);
65354
+ return initializerType && tryGetNameFromType(initializerType);
65355
+ }
65356
+ if (isEnumMember(declaration)) {
65357
+ return getTextOfPropertyName(declaration.name);
65358
+ }
65359
+ }
65360
+ return void 0;
65345
65361
  }
65346
65362
  function containsMatchingReference(source, target) {
65347
65363
  while (isAccessExpression(source)) {
@@ -76754,7 +76770,7 @@ function createTypeChecker(host) {
76754
76770
  return type;
76755
76771
  }
76756
76772
  const apparentObjectType = getApparentType(objectType);
76757
- if (getIndexInfoOfType(apparentObjectType, numberType) && isTypeAssignableToKind(indexType, 296 /* NumberLike */)) {
76773
+ if (getIndexInfoOfType(apparentObjectType, numberType) && isApplicableIndexType(indexType, numberType)) {
76758
76774
  return type;
76759
76775
  }
76760
76776
  if (isGenericObjectType(objectType)) {
package/lib/tsserver.js CHANGED
@@ -49738,11 +49738,7 @@ function createTypeChecker(host) {
49738
49738
  if (errorBindingElement) {
49739
49739
  return findAncestor(errorBindingElement, isBindingElement) !== findAncestor(declaration, isBindingElement) || declaration.pos < errorBindingElement.pos;
49740
49740
  }
49741
- const rootDeclaration = getRootDeclaration(declaration);
49742
- if (rootDeclaration.kind !== 260 /* VariableDeclaration */) {
49743
- return true;
49744
- }
49745
- return isBlockScopedNameDeclaredBeforeUse(rootDeclaration, usage);
49741
+ return isBlockScopedNameDeclaredBeforeUse(getAncestor(declaration, 260 /* VariableDeclaration */), usage);
49746
49742
  } else if (declaration.kind === 260 /* VariableDeclaration */) {
49747
49743
  return !isImmediatelyUsedInInitializerOfBlockScopedVariable(declaration, usage);
49748
49744
  } else if (isClassLike(declaration)) {
@@ -70067,9 +70063,29 @@ function createTypeChecker(host) {
70067
70063
  /*ignoreErrors*/
70068
70064
  true
70069
70065
  );
70070
- if (!symbol || symbol.valueDeclaration && !isBlockScopedNameDeclaredBeforeUse(symbol.valueDeclaration, node))
70066
+ if (!symbol || !(isConstantVariable(symbol) || symbol.flags & 8 /* EnumMember */))
70071
70067
  return void 0;
70072
- return tryGetNameFromType(getTypeOfExpression(node));
70068
+ const declaration = symbol.valueDeclaration;
70069
+ if (declaration === void 0)
70070
+ return void 0;
70071
+ const type = tryGetTypeFromEffectiveTypeNode(declaration);
70072
+ if (type) {
70073
+ const name = tryGetNameFromType(type);
70074
+ if (name !== void 0) {
70075
+ return name;
70076
+ }
70077
+ }
70078
+ if (hasOnlyExpressionInitializer(declaration) && isBlockScopedNameDeclaredBeforeUse(declaration, node)) {
70079
+ const initializer = getEffectiveInitializer(declaration);
70080
+ if (initializer) {
70081
+ const initializerType = isBindingPattern(declaration.parent) ? getTypeForBindingElement(declaration) : getTypeOfExpression(initializer);
70082
+ return initializerType && tryGetNameFromType(initializerType);
70083
+ }
70084
+ if (isEnumMember(declaration)) {
70085
+ return getTextOfPropertyName(declaration.name);
70086
+ }
70087
+ }
70088
+ return void 0;
70073
70089
  }
70074
70090
  function containsMatchingReference(source, target) {
70075
70091
  while (isAccessExpression(source)) {
@@ -81482,7 +81498,7 @@ function createTypeChecker(host) {
81482
81498
  return type;
81483
81499
  }
81484
81500
  const apparentObjectType = getApparentType(objectType);
81485
- if (getIndexInfoOfType(apparentObjectType, numberType) && isTypeAssignableToKind(indexType, 296 /* NumberLike */)) {
81501
+ if (getIndexInfoOfType(apparentObjectType, numberType) && isApplicableIndexType(indexType, numberType)) {
81486
81502
  return type;
81487
81503
  }
81488
81504
  if (isGenericObjectType(objectType)) {
package/lib/typescript.js CHANGED
@@ -47492,11 +47492,7 @@ ${lanes.join("\n")}
47492
47492
  if (errorBindingElement) {
47493
47493
  return findAncestor(errorBindingElement, isBindingElement) !== findAncestor(declaration, isBindingElement) || declaration.pos < errorBindingElement.pos;
47494
47494
  }
47495
- const rootDeclaration = getRootDeclaration(declaration);
47496
- if (rootDeclaration.kind !== 260 /* VariableDeclaration */) {
47497
- return true;
47498
- }
47499
- return isBlockScopedNameDeclaredBeforeUse(rootDeclaration, usage);
47495
+ return isBlockScopedNameDeclaredBeforeUse(getAncestor(declaration, 260 /* VariableDeclaration */), usage);
47500
47496
  } else if (declaration.kind === 260 /* VariableDeclaration */) {
47501
47497
  return !isImmediatelyUsedInInitializerOfBlockScopedVariable(declaration, usage);
47502
47498
  } else if (isClassLike(declaration)) {
@@ -67821,9 +67817,29 @@ ${lanes.join("\n")}
67821
67817
  /*ignoreErrors*/
67822
67818
  true
67823
67819
  );
67824
- if (!symbol || symbol.valueDeclaration && !isBlockScopedNameDeclaredBeforeUse(symbol.valueDeclaration, node))
67820
+ if (!symbol || !(isConstantVariable(symbol) || symbol.flags & 8 /* EnumMember */))
67825
67821
  return void 0;
67826
- return tryGetNameFromType(getTypeOfExpression(node));
67822
+ const declaration = symbol.valueDeclaration;
67823
+ if (declaration === void 0)
67824
+ return void 0;
67825
+ const type = tryGetTypeFromEffectiveTypeNode(declaration);
67826
+ if (type) {
67827
+ const name = tryGetNameFromType(type);
67828
+ if (name !== void 0) {
67829
+ return name;
67830
+ }
67831
+ }
67832
+ if (hasOnlyExpressionInitializer(declaration) && isBlockScopedNameDeclaredBeforeUse(declaration, node)) {
67833
+ const initializer = getEffectiveInitializer(declaration);
67834
+ if (initializer) {
67835
+ const initializerType = isBindingPattern(declaration.parent) ? getTypeForBindingElement(declaration) : getTypeOfExpression(initializer);
67836
+ return initializerType && tryGetNameFromType(initializerType);
67837
+ }
67838
+ if (isEnumMember(declaration)) {
67839
+ return getTextOfPropertyName(declaration.name);
67840
+ }
67841
+ }
67842
+ return void 0;
67827
67843
  }
67828
67844
  function containsMatchingReference(source, target) {
67829
67845
  while (isAccessExpression(source)) {
@@ -79236,7 +79252,7 @@ ${lanes.join("\n")}
79236
79252
  return type;
79237
79253
  }
79238
79254
  const apparentObjectType = getApparentType(objectType);
79239
- if (getIndexInfoOfType(apparentObjectType, numberType) && isTypeAssignableToKind(indexType, 296 /* NumberLike */)) {
79255
+ if (getIndexInfoOfType(apparentObjectType, numberType) && isApplicableIndexType(indexType, numberType)) {
79240
79256
  return type;
79241
79257
  }
79242
79258
  if (isGenericObjectType(objectType)) {
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@typescript-deploys/pr-build",
3
3
  "author": "Microsoft Corp.",
4
4
  "homepage": "https://www.typescriptlang.org/",
5
- "version": "5.4.0-pr-56392-10",
5
+ "version": "5.4.0-pr-56878-6",
6
6
  "license": "Apache-2.0",
7
7
  "description": "TypeScript is a language for application scale JavaScript development",
8
8
  "keywords": [
@@ -114,5 +114,5 @@
114
114
  "node": "20.1.0",
115
115
  "npm": "8.19.4"
116
116
  },
117
- "gitHead": "61dc1bc3d564f6e826f3e71906739e211c36705b"
117
+ "gitHead": "5a05f78d175d6dff8785929533135d4603e5b4c8"
118
118
  }