Top-level this-assignments do not support computed properties. But the
binder forgets to check for computed properties and tries to bind them
normally. This hits a helpful assert.
This change stop binding this-properties with computed properties at the
top-level. There's nothing sensible we could do with them; we're unable
to late-bind entries to the global scope or to modules.
* Test
* Handle import type node when handling the namespace import and reexport
Fixes#33017
* Handle qualifier of the importTypeNode
* Handle export specifier
* Fix rename prefix when search for rename starts at qualifier in import type ndoe
* Fix rename of qualifier with importType node when invoked without provideSuffixAndPrefix option
* Create different watch options in compiler options
* Thread through the new watch options
* Actually use the options passed through for watch strategy
* Support delay on updating child directory watches
* Make watchOptions separate from compilerOptions
* Support passing watch options from command line
* Handle displaying of watchOptions
* Add isInferredProject, isConfiguredProject and isExternalProject
* Skip refreshing configured project on change of config file if its not loaded
* Open a tree of projects when doing findAllRefs or rename operations
* Fix addToSeen project key
* Refactor combineProjectsOutputWorker
* if the definition is local, no need to load and look in other projects
* Add disableSearchSolution as option to disable looking for solution
* Rename the option to disableSolutionSearching
* Add isInferredProject, isConfiguredProject and isExternalProject
* Add test for rename on file with case change that fails
Test for #25460
* Dont store fileName on text storage
* Store root file names in the root file map to reflect their name
* Delay open file triggering watches
* Correct the name of source file as we query it (eg. it could be same source file returned in old program with different casing on case insensitive file name)
* More tests
* Refactoring
* Cache bind And check diagnostics and always get program diagnostics from the program
* Another test
* Try to report conflicting file error on file instead of global diagnostics
* Create better tests for module resolution diagnostics check
* Fix lint errors
* Move most harness globals into namespaces
* Remove forward declaration from `createMapShim` and move all `Map` declarations into one file
* A small pile of more changes to get the harness transforming
* Move codefix types into services/types.ts
* Also split apart refactorProvider
* Move all meanings of DocumentHighlights into one file
* Use setter for object allocator
* Remove unneeded namespace reference
* Remove some shorthand references to nonlocal namespace variables
* Convert WatchType string enum to a structure that can be merged across modules
* Rename harness to harnessIO
* Move accidental globals into namespace
* Remove unused globals
* Suppress lints - these qualifiers are needed for the migration to go smoothly
* Hide global declaration
Type-argument defaulting is handled elsewhere in the compiler.
This is a small drive-by improvement, so I didn't change the handling of
'array' or 'promise'; they still manually create `any[]` and
`Promise<any>`, respectively.
* Remove redundant checker functions, use patterns more friendly to modules
* Also use a helper for localizedDiagnosticMessages
* Move types into same file as consts
* Accept slightly changed api baseline
* Whitespace!
It's also defined in `corePublic.ts` - there's no errors because they're (almost) identical and merge (creating a redundant overload for `push`). Ironically, while this definition was internal, the other is public (and more complete).
When using `{import('./b').FOO}` which is defined as a string literal,
`valueType` doesn't have a `symbol`. Leave it for the fallback value
for now.
This was exposed in 8223c0752.
Fixes#34869.
* When calculating spreads, merge empty object into nonempty object to produce partial object to reduce complexity
* Actually accept remainder of baselines
* Limit simplification to single prop or partial types
* Normalize type references before relating them in isRelatedTo
* Add comments
* Accept new baselines
* Add regression tests
* Accept new baselines
* Use aliases when available in error reporting
* Accept new baselines
* Emit defineProperty calls before param prop assignments
Note that I restricted this to --useDefineForClassFields is true.
Nothing changes when it's off. I think this is the correct fix for a
patch release.
However, in principal there's nothing wrong with moving parameter
property initialisation after property declaration initialisation. It
would be Extremely Bad and Wrong to rely on this working:
```ts
class C {
p = this.q // what is q?
constructor(public q: number) { }
}
```
But today it does, and probably somebody relies on it without knowing.
* Put parameter property initialiser into defineProperty's value
* Combine ES5/ESNext into one test
* useDefineForClassFields skips emit of ambient properties
Previously:
```ts
class C {
declare p
}
```
would incorrectly emit
```js
class C {
constructor() {
Object.defineProperty(this, "p", {
enumerable: true,
configurable: true,
writable: true,
value: void 0
});
}
}
```
when useDefineForClassFields was turned on (for targets <ESNext).
* Fix bug for ESNext as well
This moves the check earlier in the pipeline.
* update baselines
* Fix up quotation marks in error messages in JavaScript files.
* Accepted baselines.
* Typescript -> TypeScript
* Accepted baselines.
* Migrate syntactic diagnostics tests to baselining tests.
* Accepted baselines.
* Update diagnosticMessages.json
* Removed markers.
* Add ability to baseline both semantic and syntactic diagnostics.
* Fix up broken diagnostics when using a server LS.
* Accepted baselines.
* Lints.
* Fake up sourcefile objects in the tsserver session client instead.
* Fewer allocations.