Skip to content

Commit 49a48ff

Browse files
benbraoumhegazy
authored andcommitted
fix(es2018): add a target and an initial lib (#20385)
* run Jake LKG before es2018 addition Fixes #20342 * fix(es2018): add a target and an initial lib Fixes #20342
1 parent 08c6dc9 commit 49a48ff

File tree

61 files changed

+149338
-75703
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+149338
-75703
lines changed

Gulpfile.ts

+7-1
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,10 @@ const es2017LibrarySource = [
145145
const es2017LibrarySourceMap = es2017LibrarySource.map(source =>
146146
({ target: "lib." + source, sources: ["header.d.ts", source] }));
147147

148+
const es2018LibrarySource = [];
149+
const es2018LibrarySourceMap = es2018LibrarySource.map(source =>
150+
({ target: "lib." + source, sources: ["header.d.ts", source] }));
151+
148152
const esnextLibrarySource = [
149153
"esnext.asynciterable.d.ts"
150154
];
@@ -166,15 +170,17 @@ const librarySourceMap = [
166170
{ target: "lib.es2015.d.ts", sources: ["header.d.ts", "es2015.d.ts"] },
167171
{ target: "lib.es2016.d.ts", sources: ["header.d.ts", "es2016.d.ts"] },
168172
{ target: "lib.es2017.d.ts", sources: ["header.d.ts", "es2017.d.ts"] },
173+
{ target: "lib.es2018.d.ts", sources: ["header.d.ts", "es2018.d.ts"] },
169174
{ target: "lib.esnext.d.ts", sources: ["header.d.ts", "esnext.d.ts"] },
170175

171176
// JavaScript + all host library
172177
{ target: "lib.d.ts", sources: ["header.d.ts", "es5.d.ts"].concat(hostsLibrarySources) },
173178
{ target: "lib.es6.d.ts", sources: ["header.d.ts", "es5.d.ts"].concat(es2015LibrarySources, hostsLibrarySources, "dom.iterable.d.ts") },
174179
{ target: "lib.es2016.full.d.ts", sources: ["header.d.ts", "es2016.d.ts"].concat(hostsLibrarySources, "dom.iterable.d.ts") },
175180
{ target: "lib.es2017.full.d.ts", sources: ["header.d.ts", "es2017.d.ts"].concat(hostsLibrarySources, "dom.iterable.d.ts") },
181+
{ target: "lib.es2018.full.d.ts", sources: ["header.d.ts", "es2018.d.ts"].concat(hostsLibrarySources, "dom.iterable.d.ts") },
176182
{ target: "lib.esnext.full.d.ts", sources: ["header.d.ts", "esnext.d.ts"].concat(hostsLibrarySources, "dom.iterable.d.ts") },
177-
].concat(es2015LibrarySourceMap, es2016LibrarySourceMap, es2017LibrarySourceMap, esnextLibrarySourceMap);
183+
].concat(es2015LibrarySourceMap, es2016LibrarySourceMap, es2017LibrarySourceMap, es2018LibrarySourceMap, esnextLibrarySourceMap);
178184

179185
const libraryTargets = librarySourceMap.map(f =>
180186
path.join(builtLocalDirectory, f.target));

Jakefile.js

+9-1
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,12 @@ var es2017LibrarySourceMap = es2017LibrarySource.map(function (source) {
205205
return { target: "lib." + source, sources: ["header.d.ts", source] };
206206
});
207207

208+
var es2018LibrarySource = [];
209+
210+
var es2018LibrarySourceMap = es2018LibrarySource.map(function (source) {
211+
return { target: "lib." + source, sources: ["header.d.ts", source] };
212+
});
213+
208214
var esnextLibrarySource = [
209215
"esnext.asynciterable.d.ts"
210216
];
@@ -227,15 +233,17 @@ var librarySourceMap = [
227233
{ target: "lib.es2015.d.ts", sources: ["header.d.ts", "es2015.d.ts"] },
228234
{ target: "lib.es2016.d.ts", sources: ["header.d.ts", "es2016.d.ts"] },
229235
{ target: "lib.es2017.d.ts", sources: ["header.d.ts", "es2017.d.ts"] },
236+
{ target: "lib.es2018.d.ts", sources: ["header.d.ts", "es2018.d.ts"] },
230237
{ target: "lib.esnext.d.ts", sources: ["header.d.ts", "esnext.d.ts"] },
231238

232239
// JavaScript + all host library
233240
{ target: "lib.d.ts", sources: ["header.d.ts", "es5.d.ts"].concat(hostsLibrarySources) },
234241
{ target: "lib.es6.d.ts", sources: ["header.d.ts", "es5.d.ts"].concat(es2015LibrarySources, hostsLibrarySources, "dom.iterable.d.ts") },
235242
{ target: "lib.es2016.full.d.ts", sources: ["header.d.ts", "es2016.d.ts"].concat(hostsLibrarySources, "dom.iterable.d.ts") },
236243
{ target: "lib.es2017.full.d.ts", sources: ["header.d.ts", "es2017.d.ts"].concat(hostsLibrarySources, "dom.iterable.d.ts") },
244+
{ target: "lib.es2018.full.d.ts", sources: ["header.d.ts", "es2018.d.ts"].concat(hostsLibrarySources, "dom.iterable.d.ts") },
237245
{ target: "lib.esnext.full.d.ts", sources: ["header.d.ts", "esnext.d.ts"].concat(hostsLibrarySources, "dom.iterable.d.ts") },
238-
].concat(es2015LibrarySourceMap, es2016LibrarySourceMap, es2017LibrarySourceMap, esnextLibrarySourceMap);
246+
].concat(es2015LibrarySourceMap, es2016LibrarySourceMap, es2017LibrarySourceMap, es2018LibrarySourceMap, esnextLibrarySourceMap);
239247

240248
var libraryTargets = librarySourceMap.map(function (f) {
241249
return path.join(builtLocalDirectory, f.target);

lib/cancellationToken.js

-2
Original file line numberDiff line numberDiff line change
@@ -69,5 +69,3 @@ function createCancellationToken(args) {
6969
}
7070
}
7171
module.exports = createCancellationToken;
72-
73-
//# sourceMappingURL=cancellationToken.js.map

lib/cs/diagnosticMessages.generated.json

+972
Large diffs are not rendered by default.

lib/de/diagnosticMessages.generated.json

+972
Large diffs are not rendered by default.

lib/enu/diagnosticMessages.generated.json.lcg

+5,834
Large diffs are not rendered by default.

lib/es/diagnosticMessages.generated.json

+972
Large diffs are not rendered by default.

lib/fr/diagnosticMessages.generated.json

+972
Large diffs are not rendered by default.

lib/it/diagnosticMessages.generated.json

+972
Large diffs are not rendered by default.

lib/ja/diagnosticMessages.generated.json

+972
Large diffs are not rendered by default.

lib/ko/diagnosticMessages.generated.json

+972
Large diffs are not rendered by default.

lib/lib.d.ts

+1,053-503
Large diffs are not rendered by default.

lib/lib.dom.d.ts

+997-481
Large diffs are not rendered by default.

lib/lib.dom.iterable.d.ts

+25-17
Original file line numberDiff line numberDiff line change
@@ -24,23 +24,6 @@ interface DOMTokenList {
2424
[Symbol.iterator](): IterableIterator<string>;
2525
}
2626

27-
interface FormData {
28-
/**
29-
* Returns an array of key, value pairs for every entry in the list
30-
*/
31-
entries(): IterableIterator<[string, string | File]>;
32-
/**
33-
* Returns a list of keys in the list
34-
*/
35-
keys(): IterableIterator<string>;
36-
/**
37-
* Returns a list of values in the list
38-
*/
39-
values(): IterableIterator<string | File>;
40-
41-
[Symbol.iterator](): IterableIterator<string | File>;
42-
}
43-
4427
interface Headers {
4528
[Symbol.iterator](): IterableIterator<[string, string]>;
4629
/**
@@ -107,6 +90,31 @@ interface NodeListOf<TNode extends Node> {
10790
[Symbol.iterator](): IterableIterator<TNode>;
10891
}
10992

93+
interface HTMLCollectionBase {
94+
[Symbol.iterator](): IterableIterator<Element>;
95+
}
96+
97+
interface HTMLCollectionOf<T extends Element> {
98+
[Symbol.iterator](): IterableIterator<T>;
99+
}
100+
101+
interface FormData {
102+
/**
103+
* Returns an array of key, value pairs for every entry in the list
104+
*/
105+
entries(): IterableIterator<[string, string | File]>;
106+
/**
107+
* Returns a list of keys in the list
108+
*/
109+
keys(): IterableIterator<string>;
110+
/**
111+
* Returns a list of values in the list
112+
*/
113+
values(): IterableIterator<string | File>;
114+
115+
[Symbol.iterator](): IterableIterator<string | File>;
116+
}
117+
110118
interface URLSearchParams {
111119
/**
112120
* Returns an array of key, value pairs for every entry in the search params

lib/lib.es2015.core.d.ts

+11-3
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ interface Array<T> {
3030
* @param thisArg If provided, it will be used as the this value for each invocation of
3131
* predicate. If it is not provided, undefined is used instead.
3232
*/
33+
find<S extends T>(predicate: (this: void, value: T, index: number, obj: T[]) => value is S, thisArg?: any): S | undefined;
3334
find(predicate: (value: T, index: number, obj: T[]) => boolean, thisArg?: any): T | undefined;
3435

3536
/**
@@ -69,10 +70,16 @@ interface ArrayConstructor {
6970
/**
7071
* Creates an array from an array-like object.
7172
* @param arrayLike An array-like object to convert to an array.
73+
*/
74+
from<T>(arrayLike: ArrayLike<T>): T[];
75+
76+
/**
77+
* Creates an array from an iterable object.
78+
* @param arrayLike An array-like object to convert to an array.
7279
* @param mapfn A mapping function to call on every element of the array.
7380
* @param thisArg Value of 'this' used to invoke the mapfn.
7481
*/
75-
from<T, U = T>(arrayLike: ArrayLike<T>, mapfn?: (v: T, k: number) => U, thisArg?: any): U[];
82+
from<T, U>(arrayLike: ArrayLike<T>, mapfn: (v: T, k: number) => U, thisArg?: any): U[];
7683

7784
/**
7885
* Returns a new array from a set of elements.
@@ -182,7 +189,7 @@ interface Math {
182189
* If any argument is NaN, the result is NaN.
183190
* If all arguments are either +0 or −0, the result is +0.
184191
*/
185-
hypot(...values: number[] ): number;
192+
hypot(...values: number[]): number;
186193

187194
/**
188195
* Returns the integral part of the a numeric expression, x, removing any fractional digits.
@@ -370,6 +377,7 @@ interface ReadonlyArray<T> {
370377
* @param thisArg If provided, it will be used as the this value for each invocation of
371378
* predicate. If it is not provided, undefined is used instead.
372379
*/
380+
find<S extends T>(predicate: (this: void, value: T, index: number, obj: ReadonlyArray<T>) => value is S, thisArg?: any): S | undefined;
373381
find(predicate: (value: T, index: number, obj: ReadonlyArray<T>) => boolean, thisArg?: any): T | undefined;
374382

375383
/**
@@ -461,7 +469,7 @@ interface String {
461469

462470
/**
463471
* Returns a String value that is made from count copies appended together. If count is 0,
464-
* T is the empty String is returned.
472+
* the empty string is returned.
465473
* @param count number of copies to append
466474
*/
467475
repeat(count: number): string;

lib/lib.es2015.iterable.d.ts

+7-1
Original file line numberDiff line numberDiff line change
@@ -68,13 +68,19 @@ interface Array<T> {
6868
}
6969

7070
interface ArrayConstructor {
71+
/**
72+
* Creates an array from an iterable object.
73+
* @param iterable An iterable object to convert to an array.
74+
*/
75+
from<T>(iterable: Iterable<T>): T[];
76+
7177
/**
7278
* Creates an array from an iterable object.
7379
* @param iterable An iterable object to convert to an array.
7480
* @param mapfn A mapping function to call on every element of the array.
7581
* @param thisArg Value of 'this' used to invoke the mapfn.
7682
*/
77-
from<T, U = T>(iterable: Iterable<T>, mapfn?: (v: T, k: number) => U, thisArg?: any): U[];
83+
from<T, U>(iterable: Iterable<T>, mapfn: (v: T, k: number) => U, thisArg?: any): U[];
7884
}
7985

8086
interface ReadonlyArray<T> {

lib/lib.es2015.symbol.wellknown.d.ts

+15-2
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ interface Promise<T> {
170170
}
171171

172172
interface PromiseConstructor {
173-
readonly [Symbol.species]: Function;
173+
readonly [Symbol.species]: PromiseConstructor;
174174
}
175175

176176
interface RegExp {
@@ -222,7 +222,7 @@ interface RegExp {
222222
}
223223

224224
interface RegExpConstructor {
225-
[Symbol.species](): RegExpConstructor;
225+
readonly [Symbol.species]: RegExpConstructor;
226226
}
227227

228228
interface String {
@@ -303,3 +303,16 @@ interface Float32Array {
303303
interface Float64Array {
304304
readonly [Symbol.toStringTag]: "Float64Array";
305305
}
306+
307+
interface ArrayConstructor {
308+
readonly [Symbol.species]: ArrayConstructor;
309+
}
310+
interface MapConstructor {
311+
readonly [Symbol.species]: MapConstructor;
312+
}
313+
interface SetConstructor {
314+
readonly [Symbol.species]: SetConstructor;
315+
}
316+
interface ArrayBufferConstructor {
317+
readonly [Symbol.species]: ArrayBufferConstructor;
318+
}

0 commit comments

Comments
 (0)