3598 Commits

Author SHA1 Message Date
Wesley Wigham
0da5a7e4ba
Add missing BinaryExpression source side cases to isMatchingReference (#41765) 2020-12-01 14:47:14 -08:00
Wesley Wigham
2a3f5508ec
addImplementationSuccessElaboration admits declarations with no symbol (#41758) 2020-12-01 12:19:12 -08:00
Toan Nguyen
0c76803854
Fix typos in comments (#41307)
* Fix typo fuction -> function

* Fix typo assignement -> assignment
2020-11-30 15:02:07 -08:00
Nathan Shively-Sanders
06fb724cd1
Improve uncalled function checks (#41599)
Fixes #41586
Fixes #41588

1. For binary expressions, if the immediate parent is an IfStatement,
then check the body of the if statement. I didn't walk upward to find an
IfStatement because in my experimentation I found that binary expression
uncalled-function errors are only issued when the expression is on the left of the
top-most binary expression.

2. For property accesses with interspersed calls, I added a
CallExpression case. In fact, any expression could appear here, but I
only want to fix calls for now since that's all we've observed in
Definitely Typed, and we didn't see anything else in the user tests or RWC
tests. I also didn't examine parameters of the intermediate call
expressions, but I don't think it's needed since the intent is to avoid
false positives.
2020-11-30 14:27:19 -08:00
Anders Hejlsberg
ec1490fb44
Properly cache types for shared control flow nodes (#41665)
* Properly cache shared flow node types

* Add test
2020-11-25 14:51:38 -10:00
Oleksandr T
d163ab67c8
fix(41240): allow emitting numeric with underscored separators as-is in esnext target (#41435) 2020-11-23 17:01:42 -08:00
Martin Probst
6b04f50394
Do not parse template arguments in JavaScript files. (#36673)
Fixes #36662.
2020-11-19 11:41:35 -08:00
Oleksandr T
9bbbe5c0c7
fix(41227): change message about incorrect property access with possible replacement with static access (#41275) 2020-11-18 12:50:32 -08:00
Mateusz Burzyński
09eb3d3b9c
Fix/jsx global preferred over config implicit (#41476)
* Add actual baselines for a problem with global namespace being preferred over config & pragma implicit ones

* Fixed an issue with global React namespace being preferred over config & pragma implicit ones

* Do not try to mark JSX classic runtime symbols as used when automatic runtime is used
2020-11-17 17:52:32 -08:00
Oleksandr T
6369d89711
fix(41492): make more friendly handling the missing call function in binary expressions (#41502) 2020-11-17 09:42:27 -08:00
Nathan Shively-Sanders
64be2a8d16
Revert "Revert "feat(40197): handle uncalled function checks in binary expressions (#40260)"" (#41462)
This reverts commit cf3e28ea66bdfb4e438f86bd7d7860b66dae0ed8.
2020-11-09 11:34:41 -08:00
Sheetal Nandi
9c60d5a4d3
Dont look for properties of Object and Function type when looking to resolve named import from module with export= (#37964)
* Add tests

* Dont look at object or function type when looking for members of `export=` type to be resolved by named imports
Fixes #37165

* Create separate cache when skipping function and object property augmentation

* Lookup in both cache if not skipObjectFunctionPropertyAugment
2020-11-03 12:22:30 -08:00
Thomas Williamson
8ed251d0c7
Support xml namespace prefix for JSX elements and attributes (#37421)
* Support xml namespace prefix for JSX elements and attributes

Just as with the `-` character, `:` is now also treated specially in JSX
element and attribute names, but is only allowed a single time, and not
at the beginning or end of the name, as is specified in the JSX spec.
All tests in jsxInvalidEsprimaTestSuite still fail, but for slightly
different reasons now. Two lines in jsxEsprimaFbTestSuite were
uncommented as they included elements with namespaces, and they now pass
without error.

* Add case for colons at ends of identifier

* Add case for jsx namepsace intrinsics

* Add cases with upcase idents for jsx namespaces

* Add case for jsx namespaces with react option

* Always consider jsx names with colon to be intrinsics

* Adjust comment about chars valid in jsx names but not js idents

* Fix minor typo in namespace prefix test case variable name

* Remove misleading comments on isUnhyphenatedJsxName
2020-11-02 15:34:36 -08:00
Oleksandr T
056d01afda
fix(38283): fix incorrect parsing of static modifier (#41127) 2020-11-02 14:45:26 -08:00
okmttdhr
7db5f68144
Add index signature for anonymous object literal type (#37903)
* Use ts.map for stylistic consistency

* Show error only if noImplicitAny is set

* Accept baseline for noImplicitAnyIndexing

* Fix lint error

* Add test cases for indexedAccessWithFreshObjectLiteral
2020-11-02 14:35:56 -08:00
Oleksandr T
f646ec87fc
fix(40901): skip checking custom arguments name in a constructor (#40912) 2020-11-02 14:35:07 -08:00
Oleksandr T
075477f9cf
fix(35779): emit comments after trailing comma (#37887) 2020-11-02 14:24:55 -08:00
Wesley Wigham
479105090d
Merge pull request #41330 from weswigham/jsx-import-source-as-auto-import
Auto-include types for the jsx import source in the new jsx transforms
2020-10-30 16:51:04 -07:00
Wesley Wigham
e044b56d7f
Merge pull request #40985 from weswigham/static-decl-ref
Adjust typeof import name lookup to better match type query lookup
2020-10-30 11:13:23 -07:00
Wesley Wigham
6714998e01
Auto-include types for the jsx import source in the new jsx transforms 2020-10-29 14:17:24 -07:00
Wesley Wigham
f0f3862cd9
Merge pull request #41314 from weswigham/fix-global-jsx-ns-alias-crashes
Fix crashes when the global JSX namespace is an alias
2020-10-28 18:38:26 -07:00
Wesley Wigham
d722392d81
Fix crashes when the global JSX namespace is an alias 2020-10-28 14:31:40 -07:00
Wesley Wigham
4ec02a56b8
Bind comma expression LHS call expressions 2020-10-28 13:48:29 -07:00
Anders Hejlsberg
bd27bd8d47
Don't relate unmatched parameter positions in signatures (#41308)
* Don't relate unmatched parameter positions in signatures

* Add regression test

* Accept new baselines
2020-10-28 11:55:32 -07:00
Wesley Wigham
6acce0ca6f
Merge pull request #41075 from uhyo/fix-36958
allow type narrowing with NonNullExpression
2020-10-27 20:10:27 -07:00
Wesley Wigham
c923023494
Merge pull request #41191 from weswigham/control-flow-comma-exprs
Track control flow for comma expressions in call expressions
2020-10-27 12:37:02 -07:00
Anders Hejlsberg
f9dcd9ef98
Don't cache Ternary.Maybe results when recursion is encountered during variance measurement (#41218)
* Don't record Ternary.Maybe results in cache during recursive variance measurement

* Add regression test

* Accept new baselines

* Use Ternary.Unknown to signal variance recursion

* Add comments

* Fix comment
2020-10-27 10:53:13 -07:00
Daniel Rosenwasser
3517af8f80
Make 'getIndentString' just use a loop. (#41221)
* Make 'getIndentString' just use a loop.

* Added test.

* Accepted baselines.
2020-10-26 12:19:31 -07:00
Anders Hejlsberg
d1f87d18b1
Support partial reverse mapped inferences with tuple types (#41106)
* Support partial reverse mapped inferences with tuple types

* Add tests

* Accept new baselines
2020-10-22 11:27:41 -07:00
Wesley Wigham
6dde1621cb
Track control flow for comma expressions in call expressions 2020-10-21 12:31:29 -07:00
Andrew Branch
1f852ed747
Percent-encode source map URLs (#41102) 2020-10-20 13:11:52 -07:00
Wesley Wigham
b8dfa28ca8
Do not consider empty jsx expressions semantically important children 2020-10-19 13:34:16 -07:00
Anders Hejlsberg
3918e6c535
Move anonymous type instantiation cache from AST node to root type (#41084)
* Move anonymous type instantiation cache from AST node to root type

* Use "root" type reference as cache location for deferred type references

* Add test

Co-authored-by: Andrew Branch <andrew@wheream.io>
2020-10-19 07:26:48 -07:00
Wesley Wigham
ce1947b0be
Merge pull request #41070 from weswigham/use-minimal-endings-in-bundled-declaration-emit
Use minimal endings when generating declarations for js
2020-10-14 15:29:50 -07:00
Eli Barzilay
5b2fba3334 transformGenerators: handle CommaListExpression
Uses essentially the same code as `visitCommaExpression` (which was
moved, to keep both together and close to
`visit{Right,Left}AssociativeBinaryExpression`).

Fixes #40614.
2020-10-14 15:58:13 -04:00
Wesley Wigham
84726be01a
Merge pull request #40597 from weswigham/allow-instanceof-array-to-narrow-readonly-array
Handle the mapping between Array and ReadonlyArray in isTypeDerivedFrom
2020-10-13 15:08:17 -07:00
uhyo
58781b0d41 allow type narrowing with NonNullExpression 2020-10-13 13:00:09 +09:00
Wesley Wigham
1cdb621257
Use minimal endings when generating declarations for js 2020-10-12 16:01:32 -07:00
Andrew Branch
a09a7144e7
Fix crash resolving ImportTypeNode in JSDoc (#40838) 2020-10-12 09:33:39 -07:00
Wesley Wigham
39c2a09b1f
Fix crash due to unchecked cast in addImplementationSuccessElaboration 2020-10-09 10:53:59 -07:00
Wesley Wigham
a49099fd15
Add elaboration when call fails all overloads but succeeds against the implementation signature 2020-10-08 14:55:14 -07:00
Nathan Shively-Sanders
cf3e28ea66 Revert "feat(40197): handle uncalled function checks in binary expressions (#40260)"
This reverts commit eaf4f46c172f9899306765e38a36c9517e04b676.
2020-10-07 14:14:49 -07:00
Alex T
eaf4f46c17
feat(40197): handle uncalled function checks in binary expressions (#40260) 2020-10-07 14:06:42 -07:00
Wesley Wigham
c6734afba5
Adjust typeof import name lookup to better match type query lookup 2020-10-07 12:08:20 -07:00
Mauro Bringolf
48ad25d4b9
Add currency sign to NumberFormatOptions type (#40709) 2020-10-06 16:30:09 -07:00
Daniel Rosenwasser
3766be1bde
Test indexed access to this on intersections (#40967)
* Added test.

* Accepted baselines.
2020-10-06 14:18:44 -07:00
Vincent Boivin
57661607e9
fix(40929) PromiseConstructor error message for newer versions of ECMAScript (#40931)
* Update package-lock.json

* Update package-lock.json

* Update package-lock.json

* Update package-lock.json

* Fixes #40929

Co-authored-by: TypeScript Bot <typescriptbot@microsoft.com>
2020-10-05 16:38:12 -07:00
Tiago Tristao
1191e2e731
Fix class expression from being assignable if types don't match (#40660)
* Fix class expression from being assignable if types don't match

* Fix class expression from being assignable if types don't match
2020-10-05 13:21:38 -07:00
Wesley Wigham
77df9faabf
Merge pull request #40886 from weswigham/error-on-anonymous-type-with-nonlocal-unique-symbol
Limit when we allow nested unique symbols to be serialized
2020-10-05 11:59:45 -07:00
Orta Therox
dd84bc1dc9
Handles creating a reasonable AST when destructuring into a parens'd expresssion (#40115)
* Handles creating a lgical AST when destructuring  into a parens

* Adds an async example
2020-10-05 14:12:47 -04:00