TypeScript/tests/cases/conformance/salsa/jsContainerMergeTsDeclaration3.ts

9 lines
138 B
TypeScript
Raw Normal View History

Better JS container binding (#24367) * Static assignments to class expressions work * Bind static properties of functions too Also update SymbolLinks in getTypeOfFuncClassEnumModule so that the type gets cached correctly. * Remove initializer handling:obj literals+type lookup Also include a couple of improved baselines * Fix 1-nested js containers:binding+cross-file merge * Consolidate check into one utility The utility is horrible and needs to change, but at least it's in one place. Next step is to make the utility like getDeclarationOfAlias, except getDeclarationOfJSAlias. * Defaulted assignments now (mostly) work * Default assignment definitely work, and IIFEs kind of do * n-nested undeclared containers now seem to work Merging even seems to work ok. * Handle prototype+prototype property assignments Perhaps in the wrong way. I have an idea how to simplify them. * Remove prototype special-case 1. It's not completely removed; the checker code in getJavascriptClassType needs to be fixed, among other places. 2. I didn't actually remove the code so that it will be easier to see what used to be there on Monday. Regardless, the code will be much simpler and seems to be mostly improved with very little work so far. * Allow more merges+accept baselines * Update more baselines * Fix js initializer check in bindPropertyAssignment * Fix codefixes * Rest of strictNullChecks cleanup + other cleanup 1. Remove a few TODOs 2. Remove extraneous SymbolFlag 3. Simplify isSameDefaultedName * Binder cleanup * Checker cleanup * Almost done with utilities cleanup * Utilities cleanup * Require js initializer to be (1) JS (2) initializer Change getDeclarationOfJSInitializer to require that the provided js initializer be in a javascript file, and that it is the initializer of the retrieved declaration. * Use getSymbolOfNode instead of accessing symbol directly * Ugh. Start over with just test cases * Handle additional cases in getTypeOfVariableOrParameterOrProperty These are cases in a really embarrassing check, in which we admit that the symbol flags steered us wrong and switch to getTypeOfFuncClassEnumModule instead (which never asserts). * Add test case for #24111 * Address PR comments
2018-05-31 20:41:26 +02:00
// @noEmit: true
// @allowJs: true
// @checkJs: true
// @Filename: a.d.ts
declare class A {}
// @Filename: b.js
const A = { };
A.d = { };