605 Commits

Author SHA1 Message Date
Jack Bates
78057a64ac Allow readonly arguments to Promise.all(), etc. 2019-09-19 11:11:59 -07:00
Ron Buckton
344dba8809
Fix incorrect parameter types for AsyncIterator next/return (#33354) 2019-09-17 21:02:12 -07:00
Alexander T
fea9e11174 Merge branch 'master' of https://github.com/Microsoft/TypeScript into feature/eslint 2019-08-20 11:07:18 +03:00
falsandtru
5ae286329f Update String#toLocale{Lower,Upper}Case methods (#32961) 2019-08-19 09:10:12 -07:00
Alexander T
b6d981aec8 Merge branch 'master' of https://github.com/Microsoft/TypeScript into feature/eslint 2019-08-16 12:13:57 +03:00
阿卡琳
a53e4a19ef Allow to omit the begin parameter of %TypedArray%.prototype.subarray (#32125)
* Allow to omit the begin parameter of %TypedArray%.prototype.subarray

* update baselines
2019-08-15 15:58:24 -07:00
Matthew Miller
c6a0739dc9 fix(docs): Fixed the docs for Array#slice not spec (#31182)
ifying that the 'end' parameter is exclusive.
2019-08-15 10:28:28 -07:00
Kagami Sascha Rosylight
f304b81fa5 Point es2020 in esnext.d.ts (#32776) 2019-08-15 10:06:46 -07:00
Alexander
b3afb55d7a disable array-type for es2019.array.d.ts 2019-08-10 10:37:33 +03:00
Alexander
ceccfd8867 array-type: [ default: array, generic: array ] 2019-08-08 21:30:18 +03:00
Alexander T
11ec6118fb @typescript-eslint/array-type 2019-07-29 18:39:11 +03:00
Alexander T
949770a4fe @typescript-eslint/triple-slash-reference 2019-07-19 10:30:40 +03:00
Alexander T
36a6028d56 Merge branch 'master' of https://github.com/Microsoft/TypeScript into feature/eslint 2019-07-19 10:16:10 +03:00
Jake Boone
c30ba7884c
Fix capitalization in parseInt description 2019-07-18 12:38:14 -07:00
Alexander T
68ae4382bd jsdoc/check-alignment 2019-07-18 15:06:56 +03:00
Alexander T
64baa804a8 Merge branch 'master' of https://github.com/Microsoft/TypeScript into feature/eslint 2019-07-15 18:35:34 +03:00
Nathan Shively-Sanders
f209995a01
Update DOM: Remove carriage returns from comments (#32352) 2019-07-11 10:16:46 -07:00
Nathan Shively-Sanders
5289f2ede9
Update DOM from TSJS-lib-generator (#32335)
* Update DOM from TSJS-lib-generator

1. Update Navigator and other small updates.
2. Make ProgressEvent generic.
3. Make `window: Window & typeof globalThis`.
4. Add types:
  * CSS Overflow
  * CSS Masking
  * Web Authentication
  * WebGL 2

The big change is that `window` now includes globals in its type via
`typeof globalThis`. This helps some codebases a lot, such as
chrome-devtools-frontend.

* Update baselines
2019-07-10 16:36:50 -07:00
Alexander T
4defd1d635 Merge branch 'master' of https://github.com/Microsoft/TypeScript into feature/eslint 2019-07-04 12:49:33 +03:00
Ron Buckton
e8bf9584aa
Improve type checking and inference for Generators and Async Generators (#30790)
* Improve typing for Generators and Async Generators

* Add TReturn and TNext to Iterator, IterableIterator, etc.

* Update ts internal Iterator to be assignable from global Iterator

* Make 'done' optional in IteratorYieldResult

* Revert Iterable and IterableIterator to simpler versions plus other fixes

* Add additional inference tests

* Added additional tests

* PR cleanup and minor async iteration type fix

* Updated diagnostics message and added non-strict tests

* Fix expected arity of Iterator/AsyncIterator
2019-07-03 21:55:59 -07:00
Alexander T
f6a50067d3 @typescript-eslint/indent 2019-06-27 11:30:03 +03:00
Alexander T
33eeceec9e Merge branch 'master' of https://github.com/Microsoft/TypeScript into feature/eslint 2019-06-19 18:48:52 +03:00
Nathan Shively-Sanders
1e6a6e9989
Update DOM and baselines (#31806) 2019-06-18 08:41:40 -07:00
Alexander T
627211b06b quotes 2019-06-14 12:18:27 +03:00
Alexander T
650600c5e4 linebreak-style 2019-06-14 11:58:42 +03:00
Alexander T
f611ec68ed microsoft-typescript/no-double-space 2019-06-14 11:52:48 +03:00
Alexander T
65ddc1fef2 microsoft-typescript/type-operator-spacing 2019-06-14 11:48:52 +03:00
ExE Boss
81f71530c4 fix(lib): Fix RegExp constructor with string|RegExp and flags (#30586) 2019-06-13 15:38:11 -07:00
Yoshiki Shibukawa
24a2ed7d83
Fix es2019.string.d.ts
trimLeft and trimRight's comments are swapped.
2019-06-09 08:43:38 +09:00
Nathan Shively-Sanders
bdf8d5c8cb Update DOM and baselines 2019-06-06 15:13:16 -07:00
Nathan Shively-Sanders
5d9d4b2553
Manually copy just postMessage changes (#31557)
* Manually copy just postMessage changes

* Update baselines
2019-05-23 13:26:41 -07:00
Nathan Shively-Sanders
b36c8a0690
Make anyArray.filter(Boolean) return any[], not unknown[] (#31515)
* Add this-parameter workaround to Array.filter

Allows anys.filter(Boolean) to once again return any[], not unknown[].

* Add any constraint to Boolean factory function

I want to test how well this works.

* Remove Boolean factory type guard

* Remove typeGuardBoolean test
2019-05-22 09:45:41 -07:00
Daniel Rosenwasser
d9e82466e2 Change Omit back to using Pick<T, Exclude<keyof T, K>> in order to maintain modifiers. 2019-05-01 14:00:11 -07:00
Kagami Sascha Rosylight
49d6f61298 Add ES2019 Object.fromEntries function (#30934)
* add ES2019 Object.fromEntries function

* add some comments

* apply suggested changes

* add readonly and general any
2019-04-30 09:49:58 -07:00
ExE Boss
1d8398265a fix(lib): Loosen Array predicate return types (#31076)
* fix(lib): Loosen `Array` predicate return types

* test(lib): Update baseline files
2019-04-30 09:47:13 -07:00
Ryan Cavanaugh
d102ec0194
Better typings for promise.race based on conditional types (#31117)
Following the feature - Mapped tuple types #25947 - it is now possible to have better typings for Promise.race
2019-04-30 09:23:27 -07:00
Forbes Lindesay
3ce3cde493 Allow Boolean() to be used to perform a null check (#29955)
* Allow Boolean() to be used to perform a null check

* Add missing test case output
2019-04-30 08:09:31 -07:00
Clay Miller
d934401265 Change the type of 'uriComponent' (passed to 'encodeURIComponent') from 'string' to 'string | number | boolean'. Fixes #18159 (#31103)
- According to the ECMAScript 5.1 spec (§15.1.3.4), 'encodeURIComponent' invokes the abstract operation 'ToString': https://www.ecma-international.org/ecma-262/5.1/#sec-15.1.3.4
- In the spec (§9.8), 'ToString' accepts an 'Undefined', 'Null', 'Boolean', 'Number', 'String' or 'Object' argument: https://www.ecma-international.org/ecma-262/5.1/#sec-9.8
- TypeScript’s 'StringConstructor' accepts an argument with type 'any': b0100100a1/lib/lib.es5.d.ts (L518)
2019-04-26 13:07:14 -07:00
Kagami Sascha Rosylight
1a75d525fa add ES2020 matchAll APIs (#30936) 2019-04-25 14:11:50 -07:00
Daniel Rosenwasser
57938e6cc2 Make Omit alias its own mapped type so that references to it never expand to Pick<...>. 2019-04-24 16:57:20 -07:00
Jordan Harband
d4ff58d53f [fix] ES5 Object.keys only accepts an object (#27089) 2019-04-24 10:18:31 -07:00
tkondo
84b8ab816c Fix iterable SetConstructor interface (#29777) 2019-04-23 13:27:30 -07:00
Nathan Shively-Sanders
84427ea90e Update DOM 2019/04/11 (#30867)
* Update DOM 2019/04/11

* Update baselines
2019-04-11 13:27:21 -07:00
Nathan Shively-Sanders
c9f44f54c6 Merge branch 'master' into update-dom-042019 2019-04-08 09:06:34 -07:00
Nathan Shively-Sanders
1e7482ad05 Update DOM 04-04-2019 2019-04-04 10:27:48 -07:00
Daniel Rosenwasser
13d2b8d617 Add the Omit helper type. 2019-04-04 10:01:34 -07:00
Nathan Shively-Sanders
32054f1c31
Forbid accessing block-scoped variables on globalThis (#30510)
* Forbid accessing const & let on globalThis

It's just an error; you still get the type of the property.

* Disallow access of blockscoped vars on globalThis

Also change Array, Function, String, et al from `const` to `var` so that
they remain accessible via `globalThis.String`.

* Update baselines after lib.d.ts change

Note especially the change in redefineArray, which is now allowed as
long as you provide a type that is assignable to ArrayConstructor.

* Remove blockscoped vars from typeof globalThis

Unlike forbidding them, this removes the properties entirely.

Unfortunately, this means that accessing these properties is only an
error with noImplicitAny, and that error is quite confusing.

Let's discuss our options. I see 3:

1. Forbid access of block-scoped vars as properties (in all flag
settings), but leave them on the type. Simple to implement.
2. Remove block-scoped vars from the globalThis type. Has the bad
error/flag behaviour described above, but simple to implement.
3. Remove block-scoped vars from the globalThis type. Also, forbid
accessing them by executing another resolveName lookup for failed
property accesses on globalThisSymbol. If the second lookup returns a
blockscoped var, issue an error instead of falling back to the index
signature. This seems too complex to me.

* Update baselines

* Better error for block-scoped usage on globalThis

So that value-space references have as clear an error as type-space
references.

* Update fourslash tests

* Fix semi-colon lint

* Don't copy so much when filtering blockscoped vars
2019-03-25 14:07:48 -07:00
Sheetal Nandi
027d65a920 Fix map constructor to accept readonly tuple
Fixes #29721
2019-03-13 14:52:58 -07:00
Kagami Sascha Rosylight
13c72b786e Merge remote-tracking branch 'upstream/master' into es2019 2019-02-08 06:55:56 +09:00
Kagami Sascha Rosylight
b3c179540a String.prototype.{trimStart,trimEnd} hit stage 4 2019-02-08 00:51:23 +09:00