Neither `x[0]` nor `x[(0)]` should be dynamic names. Previously, the
latter was because `isDynamicName` didn't skip parentheses.
Since the binder treats dynamic names in property assignments as
assignment declarations, this incorrectly tried to create a binding for
expressions like `x[(0)] = 1`.
This caused an assert because `x[(0)]` would not take the dynamic name
code path during binding (`hasDynamicName` returned false), but the
normal code path for static names.
* fix(38750): create unique names for keywords and re-export them with original names
* Serialize (noncontextual) keyword named namespace members with export declarations in both declaration emitters
* Add exhaustive keyword emit test for js declaration emitter and fix it up
Co-authored-by: Alexander T <alexander.tarasyuk@outlook.com>
This completes the work that started in PR #33069, and fixes#32835.
There are probably two additional related changes that are needed to
make this more complete:
* Fix the code that composes the error message (see the first two
`FIXME`s in `callWithSpread3.ts`).
* Fix the code that checks the argument types (second two `FIXME`s).
* There is also an error in `genericRestParameters1.ts` which changed
but should not be an error in the first place. Added a `FIXME` there
too. (Probably will work if the previous iterm is done.)
In addition, `getEffectiveCallArguments` munges the arguments in case of
a spread in the last argument which might be better to avoid. (I think
that there are cases where it wouldn't work anyway, such as a spread of
an array followed by a spread of an empty array.)
* Emit buildinfo when there are errors with noEmitOnError?
TODO: --build mode
* Always emit tsbuild info even if there are non syntax errors in tsc --build mode
* Sort affectedFilesPendingEmit for consistent build info text
* add skeleton
* add getAvailableActions
* add working getEditsForAction
* add multi vardecl
* fix multi decl bug
* change refactor name
* add tests for ToAnon, ToArrow and available arrow
* add tests for ToNamed and available anon
* add tests for ReturnType and available Arrow as FnParam
* fix bug modifiers by toNamed
* add tests for modifiers
* fix for tslint error
* adapt one test case
* refactor getInfo getAvailableActions
* refactor small progress
* extract creation of block
* extract creation of funcDeclaration
* make guideline compliant
* apply feedback from pr
* add testcase and apply feedback from pr
* apply feedback from pr
* add newline
* rename testcases
* Make conditions more expressive
* fix for unnecessary duplication of comment
* apply feedback from pr
* update getAvailableActions
* check if functionExpression name is used
* add more testcases
* do not provide refactoring when it contains this
because this behaves differently in arrow than in function
* exclude nested functions and classes at containingThis check
* fix linting error
* fix line endings
Co-authored-by: BigAru <arooran@indikon.ch>
Co-authored-by: bigaru <bigaru@users.noreply.github.com>
Co-authored-by: Jesse Trinity <42591254+jessetrinity@users.noreply.github.com>
Co-authored-by: Jesse Trinity <jetrinit@microsoft.com>