580 Commits

Author SHA1 Message Date
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
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
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
Kagami Sascha Rosylight
f525a89e87 Array.prototype.{flat,flatMap} hit stage 4 2019-02-08 00:10:34 +09:00
Kagami Sascha Rosylight
a8823f5169
Merge branch 'master' into es2019 2019-02-07 10:08:26 +09:00
Kagami Sascha Rosylight
2c4589d5a9 Merge remote-tracking branch 'upstream/master' into async-es2018 2019-02-07 09:51:26 +09:00
Nathan Shively-Sanders
2f9218f346
DOM update February 2019 (#29690)
* DOM update February 2019

* Update some baselines

* Update mappedTypeRecursiveInference baselines
2019-02-04 15:25:41 -08:00
Ryan Cavanaugh
4ff71ecb98
Merge pull request #29696 from Microsoft/filter-unknown
Use unknown for array predicates' return types
2019-02-04 13:26:29 -08:00
Anders Hejlsberg
f86b635122
Merge pull request #29705 from Microsoft/fixParametersAndReturnType
Less restrictive Parameters<T> and ReturnType<T>
2019-02-04 12:08:29 -08:00
Ryan Cavanaugh
0a041ee536
Merge pull request #28270 from AnyhowStep/json-parse-reviver-stringify-replacer-better-declaration
JSON.parse(), JSON.stringify() more specific declarations for #6955
2019-02-02 12:10:56 -08:00
Anders Hejlsberg
e7ad76ddc8 Less restrictive constraints in Parameters and ReturnType types 2019-02-02 09:28:21 -08:00
Ryan Cavanaugh
efbe630a13
Use unknown for array predicates' return types 2019-02-01 17:05:04 -08:00
Ryan Cavanaugh
caa8dc25a8
Merge pull request #29115 from KromDaniel/patch-1
Duplicate `wait` instead of `wait` and `notify` at `es2017.sharedmemory.d.ts`
2019-01-30 19:12:46 -08:00
Ryan Cavanaugh
c779fc7998
Merge pull request #28034 from disisisid/master
Typo fix in src/lib/README.md
2019-01-24 14:45:31 -08:00
Ryan Cavanaugh
d85c4e551e
Merge pull request #27121 from xl1/26977-typedarray
Allow non-number source for TypedArray.from
2019-01-24 13:42:43 -08:00
Kagami Sascha Rosylight
1d8a2ea38c Symbol.prototype.description hit stage 4 2019-01-06 11:42:55 +09:00
Kagami Sascha Rosylight
60996b5bed Merge remote-tracking branch 'upstream/master' into async-es2018 2018-12-26 17:15:03 +09:00
Daniel Krom
490f69f984
duplicate wait instead of wait and notify
original was
```
notify(typedArray: Int32Array, index: number, count: number): number;
```
it seems to be a mistake, the real method is `notify` (the first wait is fine)
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Atomics/notify
2018-12-21 10:41:24 +02:00
Anders Hejlsberg
9cc997fca7 Improve typing of 'bind' method on function types 2018-12-08 11:02:19 -08:00
AnyhowStep
dd3ed02868 Removed stray whitespace 2018-11-13 12:24:03 -05:00
Kagami Sascha Rosylight
7017d1a9ef
Merge branch 'master' into async-es2018 2018-11-12 11:04:21 +09:00
Daniel Rosenwasser
b48c2b295d
Merge pull request #24396 from falsandtru/lib/Symbol.toStringTag
Don't constrain string tag values
2018-11-09 12:29:46 -08:00
Daniel Rosenwasser
0010a38660
Merge pull request #28343 from Microsoft/lib/update-nov-2018
Lib update Nov 2018
2018-11-09 12:06:41 -08:00
Caleb Sander
0c1bf316a2 Declaration files for BigInt 2018-11-05 11:36:30 -08:00
Nathan Shively-Sanders
b830ef8214 Nov 2018 DOM update 2018-11-05 10:19:05 -08:00
AnyhowStep
01e71820fc Fixes Microsoft/TypeScript#6955 2018-10-31 17:00:24 -04:00
Nathan Shively-Sanders
996fb78445
Test update of DOM. (#28050)
Based on the few changes that have been accepted since Mohamed left.
2018-10-23 15:24:56 -07:00
Andy
afa94c527c
Un-consolidate overloads for Map and WeakMap (#28052) 2018-10-22 11:18:56 -07:00