2771 Commits

Author SHA1 Message Date
Gabriela Britto
10b9051624
Fix convert to named parameters rest parameter tuple (#30286)
* check if rest parameter is of tuple type in isOptionalParameter

* expose isArrayType and isTupleType in checker

* don't offer refactor if rest parameter type is neither array nor tuple type

* add tests for rest parameters

* fix tests for renamed refactor

* remove unnecessary conditional operator
2019-03-18 10:31:38 -07:00
Anders Hejlsberg
d0646a629a
Merge pull request #30084 from dragomirtitian/GH-26563
Improved argument description for parameters originating from tuples
2019-03-18 06:14:52 -10:00
Sheetal Nandi
bd229b5ed1 Exclude Json files from Project reference redirects from files to be emitted list
Fixes #30382
2019-03-14 11:22:26 -07:00
Anders Hejlsberg
ba95fcac87
Merge pull request #30334 from Microsoft/inferenceContextCleanup
Revise InferenceContext implementation
2019-03-12 10:13:55 -07:00
Anders Hejlsberg
de3f5f90cd Remove redundant typeParameters property from InferenceContext 2019-03-12 06:17:33 -07:00
Wenlu Wang
b97b1a8de6 add jsx factory and hold text in jsxtext node (#29439)
* add jsx factory and hold text in jsxtext node

* update jsxtext prop name and factory
2019-03-11 16:00:18 -07:00
Anders Hejlsberg
af8cf90e49 InferenceContext has-a (not is-a) mapper and has-a new nonFixingMapper 2019-03-11 15:56:03 -07:00
Anders Hejlsberg
42b6ef0c96 Rename contextualMapper to inferenceContext (which it always is) 2019-03-11 06:45:26 -07:00
Titian Cernicova-Dragomir
d433042386 Fixed isVariadic handling when signature parameters are expanded for itemInfoForParameters 2019-03-11 02:55:10 +02:00
Titian Cernicova-Dragomir
88babf2a90 Merge remote-tracking branch 'remotes/origin/master' into GH-26563 2019-03-11 02:31:07 +02:00
Anders Hejlsberg
79813b8ece Show expanded parameter lists in signature help 2019-03-09 12:23:57 -08:00
Sheetal Nandi
97fbc87e98
Merge pull request #29813 from Microsoft/incrementalBuildInfo
Build .tsbuildinfo file when building using tsc --b
2019-03-08 15:49:44 -08:00
Ron Buckton
6607e00b8f
Merge pull request #30259 from Microsoft/transformFlagCleanup
Transform flag cleanup
2019-03-08 15:08:26 -08:00
Sheetal Nandi
409d6c911e Add compiler version to buildInfo 2019-03-08 13:32:43 -08:00
Sheetal Nandi
990b199ebd Merge branch 'master' into incrementalBuildInfo 2019-03-08 11:42:19 -08:00
Ron Buckton
1c0f9a8ce3 Renumber transform flags 2019-03-07 10:52:17 -08:00
Ron Buckton
8e5178d6e6 Merge branch 'master' into transformFlagCleanup 2019-03-07 10:46:38 -08:00
Ron Buckton
1f212ec265 Remove DestructuringAssignment and Generator flags 2019-03-06 15:04:13 -08:00
Ron Buckton
cc9e2f4e57 Remove Super/ContainsSuper transform flags 2019-03-06 14:33:42 -08:00
Ron Buckton
2fb0b85cf0 Restore ContainsLexicalThsi flag for performance 2019-03-06 11:34:28 -08:00
Anders Hejlsberg
ad823daabb Consistently defer generic functions to second type inference pass 2019-03-05 06:09:54 -08:00
Anders Hejlsberg
c344ef3123 Infer higher order function types when possible 2019-03-03 14:34:38 -08:00
Sheetal Nandi
cd195c91c6 Add options tsBuildInfoFile to provide name for the buildinfo file 2019-03-01 10:28:57 -08:00
Sheetal Nandi
d53efdf380 Changes to generation of .tsbuildinfo:
- If composite or incremental then only the .tsbuildinfo will be generated
- if --out or --outFile the file is outputFile.tsbuildinfo
- if rootDir and outDir then outdir/relativePathOfConfigFromRootDir/configname.tsbuildinfo
- if just outDir then outDir/configname.tsbuild
- otherwise config.tsbuildinfo next to configFile
2019-02-28 13:46:26 -08:00
Sheetal Nandi
ed35741b5f Merge branch 'master' into incrementalBuildInfo 2019-02-27 15:45:59 -08:00
Nathan Shively-Sanders
be2db9db12
Add globalThis (#29332)
* Restore original code from bind-toplevel-this

With one or two additional comments

* Working in JS, but the symbol is not right.

Still need to

1. Make it work in Typescript.
2. Add test (and make them work) for the other uses of GlobalThis:
window, globalThis, etc.

* Check in TS also; update some tests

Lots of tests still fail, but all but 1 change so far has been correct.

* Update baselines

A couple of tests still fail and need to be fixed.

* Handle type references to globalThis

The type reference must be `typeof globalThis`. Just `globalThis` will
be treated as a value reference in type position -- an error.

* Restore former behaviour of implicitThis errors

I left the noImplicitThis rule for captured use of global this in an
arrow function, even though technically it isn't `any` any more --
it's typeof globalThis.  However, you should still use some other method
to access globals inside an arrow, because captured-global-this is super
confusing there.

* Test values with type globalThis

I ran into a problem with intersecting `Window & typeof globalThis`:

1. This adds a new index signature to Window, which is probably not
desired. In fact, with noImplicitAny, it's not desired on globalThis
either I think.
2. Adding this type requires editing TSJS-lib-generator, not this repo.

So I added the test cases and will probably update them later, when
those two problems are fixed.

* Add esnext declaration for globalThis

* Switch to symbol-based approach

I decided I didn't like the import-type-based approach.

Update baselines to reflect the difference.

* Do not suggest globals for completions at toplevel

* Add tests of element and property access

* Look up globalThis using normal resolution

globalThis is no longer constructed lazily. Its synthetic Identifier
node is also now more realistic.

* Update fourslash tests

* Add missed fourslash test update

* Remove esnext.globalthis.d.ts too

* Add chained globalThis self-lookup test

* Attempt at making globalThis readonly

In progress, had to interrupt for other work.

* Add/update tests

* Addres PR comments:

1. Add parameter to tryGetThisTypeAt to exclude globalThis.
2. Use combined Module flag instead combining them in-place.
3. SymbolDisplay doesn't print 'module globalThis' for this expressions
anymore.
2019-02-27 14:14:34 -08:00
Ron Buckton
ad4cef01a3 Removes 'TypeScript' transform flag 2019-02-25 13:26:44 -08:00
Titian Cernicova-Dragomir
8d66d55de1 Improved argument description for parameters originating from tuples that were extracted from functions. (ie mapped functions) 2019-02-25 18:18:00 +02:00
Sheetal Nandi
9fa28158bb Enable building typescript.d.ts with current source 2019-02-22 18:11:27 -08:00
Sheetal Nandi
9730cfa845 Dont emit sourceMapUrl from prepend text into the --out file 2019-02-22 14:39:47 -08:00
Sheetal Nandi
e1b18ab5fb Merge branch 'master' into incrementalBuildInfo 2019-02-22 14:19:53 -08:00
Sheetal Nandi
1e24cd19a8 Allow empty own source files 2019-02-21 17:36:20 -08:00
Wenlu Wang
592396d40a expose token flags and numeric flags (#29897)
* expose token flags and numeric flags

* hide hide useless token flags
2019-02-21 15:09:37 -08:00
Sheetal Nandi
1c8970d30b Handle synthetic references better 2019-02-20 11:37:45 -08:00
Sheetal Nandi
0cd7074e1b Handle emit when using prepends and the referencing project has --stripInternal true 2019-02-20 10:41:28 -08:00
Sheetal Nandi
a0f3420001 Add sections to the prepend (to be later used for stripInternal) 2019-02-20 10:41:26 -08:00
Sheetal Nandi
a881391dc9 Merge branch 'master' into incrementalBuildInfo 2019-02-20 10:37:44 -08:00
Anders Hejlsberg
b57956673e Move TypeFlags.PropapatingFlags to ObjectFlags to free up 3 flags 2019-02-14 14:42:55 -08:00
Sheetal Nandi
b958f1c8b5 Merge branch 'master' into incrementalBuildInfo 2019-02-14 12:19:10 -08:00
Ron Buckton
5576c3ead8 Remove ES2015 and ContainsDefaultValueassignments flags 2019-02-13 16:07:52 -08:00
Sheetal Nandi
499bc70056 Make printer option to be writing bunfle file info and use the result instead 2019-02-11 13:47:24 -08:00
Sheetal Nandi
217a34256c Move bundleFileInfo as printer options 2019-02-11 13:13:19 -08:00
Sheetal Nandi
99df3230aa Merge branch 'master' into incrementalBuildInfo 2019-02-07 15:05:58 -08:00
Sheetal Nandi
adcb79a111 Emit bundle information into bundle field of buildinfo and only if bundled emit 2019-02-07 14:32:52 -08:00
Kagami Sascha Rosylight
13c72b786e Merge remote-tracking branch 'upstream/master' into es2019 2019-02-08 06:55:56 +09:00
Sheetal Nandi
8f18cec80c Dont emit program information in --out scenarios 2019-02-07 13:01:10 -08:00
Ron Buckton
61d13b740e
Merge pull request #29726 from bmeurer/modifierFlagsCache
Make modifierFlagsCache mandatory for Node objects
2019-02-07 12:13:46 -08:00
Sheetal Nandi
e3f8c34bc9 Add mechanism to dump and read program to build info 2019-02-07 12:10:15 -08:00
Sheetal Nandi
ab7d65e01f Merge branch 'master' into usePrependToSkipBuild 2019-02-07 10:39:41 -08:00
Kagami Sascha Rosylight
582526929b restore flags 2019-02-07 10:27:50 +09:00