Component commits:
7be925173c Exclude ?? operator from true/false literal check in createFlowCondition
b9802166ae Accept new API baselines
3d4c14c5f8 Add tests
7362545e8c Accept new baselines
2d1af77839 Address CR feedback
8f0de27784 Accept new API baselines
Component commits:
97dcbd3bb9 Avoid a crash with `@typedef` in a script file.
Scripts (as opposed to modules) do not have a symbol object. If a script
contains a `@typdef` defined on a namespace called `exports`, TypeScript
crashes because it attempts to create an exported symbol on the
(non-existent) symbol of the SourceFile.
This change avoids the crash by explicitly checking if the source file
has a symbol object, i.e. whether it is a module.
f9b7d6eaa8 Add usage of exports.SomeName typedef.
92dc69ddf0 Fix bug at bind site rather than in declare func
Component commits:
056a656937 Restore delayed merge check to getTypeFromJSDocValueReference
This is needed when a function merges with a prototype assignment. The
resulting *merged* symbol is a constructor function marked with
SymbolFlags.Class. However, the merge doesn't happen until
getTypeOfFuncClassEnumModule is called, which, in the
getTypeReferenceType code path, doesn't happen until
getTypeFromJSDocValueReference. That means the check for
SymbolFlags.Class is missed.
Previously, getTypeFromJSDocValueReference had a weird check
`symbol !== getTypeOfSymbol(symbol).symbol`, which, if true, ran
getTypeReferenceType again on `getTypeOfSymbol(symbol).symbol`. For
JS "aliases", this had the effect of dereferencing the alias, and for
function-prototype merges, this had the effect of ... just trying again
after the merge had happened.
This is a confusing way to run things. getTypeReferenceType should
instead detect a function-prototype merge, cause it to happen, and
*then* run the rest of its code instead of relying on try-again logic at
the very end. However, for the RC, I want to fix this code by restoring
the old check, with an additional check to make sure that #33106 doesn't
break again:
```ts
const valueType = getTypeOfSymbol(symbol)
symbol !== valueType.symbol && getMergedSymbol(symbol) === valueType.symbol
```
I'll work on the real fix afterwards and put it into 3.8.
d1515f4ee0 Add bug number
Component commits:
2aa257df80 getTypeFromJSDocValueReference: handle import types
Previously it only handled types whose declaration was from `require`,
but now it handles types whose reference is an import type as well.
Component commits:
b6744812a0 Treat any mix of element/prop access as declaration in JS
Fixes#34642 but, notably, doesn't actually make the assignment into a
working declaration. It just fixes the crash.
Component commits:
b6744812a0 Treat any mix of element/prop access as declaration in JS
Fixes#34642 but, notably, doesn't actually make the assignment into a
working declaration. It just fixes the crash.
* Fix crash in expando assignment to alias
This PR disallows expando assignments
Fixes#34493, but disallows the prototype assignment nonetheless.
* Revert mistaken changes
* Fix stack overflow in circular assignment declaration
It also needs to have multiple assignments so that it has a ValueModule
flag.
Fixes#33006
* remove errant comment
* Remove other possible circularity
* Restore fallback with additional condition