Skip to content

Commit 47ed6cc

Browse files
committed
Merge branch 'master' into libReferenceDirective
2 parents 8a7abbf + d82a57e commit 47ed6cc

File tree

496 files changed

+50276
-25384
lines changed

Some content is hidden

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

496 files changed

+50276
-25384
lines changed

Gulpfile.ts

+9-2
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,7 @@ const es2017LibrarySource = [
131131
"es2017.object.d.ts",
132132
"es2017.sharedmemory.d.ts",
133133
"es2017.string.d.ts",
134+
"es2017.intl.d.ts",
134135
];
135136

136137
const es2017LibrarySourceMap = es2017LibrarySource.map(function(source) {
@@ -935,7 +936,7 @@ gulp.task(loggedIOJsPath, /*help*/ false, [], (done) => {
935936
const temp = path.join(builtLocalDirectory, "temp");
936937
mkdirP(temp, (err) => {
937938
if (err) { console.error(err); done(err); process.exit(1); }
938-
exec(host, [LKGCompiler, "--types --outdir", temp, loggedIOpath], () => {
939+
exec(host, [LKGCompiler, "--types", "--target es5", "--lib es5", "--outdir", temp, loggedIOpath], () => {
939940
fs.renameSync(path.join(temp, "/harness/loggedIO.js"), loggedIOJsPath);
940941
del(temp).then(() => done(), done);
941942
}, done);
@@ -946,7 +947,13 @@ const instrumenterPath = path.join(harnessDirectory, "instrumenter.ts");
946947
const instrumenterJsPath = path.join(builtLocalDirectory, "instrumenter.js");
947948
gulp.task(instrumenterJsPath, /*help*/ false, [servicesFile], () => {
948949
const settings: tsc.Settings = getCompilerSettings({
949-
outFile: instrumenterJsPath
950+
outFile: instrumenterJsPath,
951+
target: "es5",
952+
lib: [
953+
"es6",
954+
"dom",
955+
"scripthost"
956+
]
950957
}, /*useBuiltCompiler*/ true);
951958
return gulp.src(instrumenterPath)
952959
.pipe(newer(instrumenterJsPath))

Jakefile.js

+5-3
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,7 @@ var harnessSources = harnessCoreSources.concat([
129129
"initializeTSConfig.ts",
130130
"printer.ts",
131131
"textChanges.ts",
132+
"telemetry.ts",
132133
"transform.ts",
133134
"customTransforms.ts",
134135
].map(function (f) {
@@ -172,7 +173,8 @@ var es2016LibrarySourceMap = es2016LibrarySource.map(function (source) {
172173
var es2017LibrarySource = [
173174
"es2017.object.d.ts",
174175
"es2017.sharedmemory.d.ts",
175-
"es2017.string.d.ts"
176+
"es2017.string.d.ts",
177+
"es2017.intl.d.ts"
176178
];
177179

178180
var es2017LibrarySourceMap = es2017LibrarySource.map(function (source) {
@@ -1078,7 +1080,7 @@ var loggedIOJsPath = builtLocalDirectory + 'loggedIO.js';
10781080
file(loggedIOJsPath, [builtLocalDirectory, loggedIOpath], function () {
10791081
var temp = builtLocalDirectory + 'temp';
10801082
jake.mkdirP(temp);
1081-
var options = "--types --outdir " + temp + ' ' + loggedIOpath;
1083+
var options = "--target es5 --lib es6 --types --outdir " + temp + ' ' + loggedIOpath;
10821084
var cmd = host + " " + LKGDirectory + compilerFilename + " " + options + " ";
10831085
console.log(cmd + "\n");
10841086
var ex = jake.createExec([cmd]);
@@ -1092,7 +1094,7 @@ file(loggedIOJsPath, [builtLocalDirectory, loggedIOpath], function () {
10921094

10931095
var instrumenterPath = harnessDirectory + 'instrumenter.ts';
10941096
var instrumenterJsPath = builtLocalDirectory + 'instrumenter.js';
1095-
compileFile(instrumenterJsPath, [instrumenterPath], [tscFile, instrumenterPath].concat(libraryTargets), [], /*useBuiltCompiler*/ true);
1097+
compileFile(instrumenterJsPath, [instrumenterPath], [tscFile, instrumenterPath].concat(libraryTargets), [], /*useBuiltCompiler*/ true, { lib: "es6", types: ["node"] });
10961098

10971099
desc("Builds an instrumented tsc.js");
10981100
task('tsc-instrumented', [loggedIOJsPath, instrumenterJsPath, tscFile], function () {

lib/cancellationToken.js

+2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/lib.d.ts

+28-20
Original file line numberDiff line numberDiff line change
@@ -1406,6 +1406,14 @@ interface ArrayBuffer {
14061406
slice(begin: number, end?: number): ArrayBuffer;
14071407
}
14081408

1409+
/**
1410+
* Allowed ArrayBuffer types for the buffer of an ArrayBufferView and related Typed Arrays.
1411+
*/
1412+
interface ArrayBufferTypes {
1413+
ArrayBuffer: ArrayBuffer;
1414+
}
1415+
type ArrayBufferLike = ArrayBufferTypes[keyof ArrayBufferTypes];
1416+
14091417
interface ArrayBufferConstructor {
14101418
readonly prototype: ArrayBuffer;
14111419
new (byteLength: number): ArrayBuffer;
@@ -1417,7 +1425,7 @@ interface ArrayBufferView {
14171425
/**
14181426
* The ArrayBuffer instance referenced by the array.
14191427
*/
1420-
buffer: ArrayBuffer;
1428+
buffer: ArrayBufferLike;
14211429

14221430
/**
14231431
* The length in bytes of the array.
@@ -1559,7 +1567,7 @@ interface DataView {
15591567
}
15601568

15611569
interface DataViewConstructor {
1562-
new (buffer: ArrayBuffer, byteOffset?: number, byteLength?: number): DataView;
1570+
new (buffer: ArrayBufferLike, byteOffset?: number, byteLength?: number): DataView;
15631571
}
15641572
declare const DataView: DataViewConstructor;
15651573

@@ -1576,7 +1584,7 @@ interface Int8Array {
15761584
/**
15771585
* The ArrayBuffer instance referenced by the array.
15781586
*/
1579-
readonly buffer: ArrayBuffer;
1587+
readonly buffer: ArrayBufferLike;
15801588

15811589
/**
15821590
* The length in bytes of the array.
@@ -1819,7 +1827,7 @@ interface Int8ArrayConstructor {
18191827
readonly prototype: Int8Array;
18201828
new (length: number): Int8Array;
18211829
new (array: ArrayLike<number>): Int8Array;
1822-
new (buffer: ArrayBuffer, byteOffset?: number, length?: number): Int8Array;
1830+
new (buffer: ArrayBufferLike, byteOffset?: number, length?: number): Int8Array;
18231831

18241832
/**
18251833
* The size in bytes of each element in the array.
@@ -1860,7 +1868,7 @@ interface Uint8Array {
18601868
/**
18611869
* The ArrayBuffer instance referenced by the array.
18621870
*/
1863-
readonly buffer: ArrayBuffer;
1871+
readonly buffer: ArrayBufferLike;
18641872

18651873
/**
18661874
* The length in bytes of the array.
@@ -2104,7 +2112,7 @@ interface Uint8ArrayConstructor {
21042112
readonly prototype: Uint8Array;
21052113
new (length: number): Uint8Array;
21062114
new (array: ArrayLike<number>): Uint8Array;
2107-
new (buffer: ArrayBuffer, byteOffset?: number, length?: number): Uint8Array;
2115+
new (buffer: ArrayBufferLike, byteOffset?: number, length?: number): Uint8Array;
21082116

21092117
/**
21102118
* The size in bytes of each element in the array.
@@ -2145,7 +2153,7 @@ interface Uint8ClampedArray {
21452153
/**
21462154
* The ArrayBuffer instance referenced by the array.
21472155
*/
2148-
readonly buffer: ArrayBuffer;
2156+
readonly buffer: ArrayBufferLike;
21492157

21502158
/**
21512159
* The length in bytes of the array.
@@ -2389,7 +2397,7 @@ interface Uint8ClampedArrayConstructor {
23892397
readonly prototype: Uint8ClampedArray;
23902398
new (length: number): Uint8ClampedArray;
23912399
new (array: ArrayLike<number>): Uint8ClampedArray;
2392-
new (buffer: ArrayBuffer, byteOffset?: number, length?: number): Uint8ClampedArray;
2400+
new (buffer: ArrayBufferLike, byteOffset?: number, length?: number): Uint8ClampedArray;
23932401

23942402
/**
23952403
* The size in bytes of each element in the array.
@@ -2429,7 +2437,7 @@ interface Int16Array {
24292437
/**
24302438
* The ArrayBuffer instance referenced by the array.
24312439
*/
2432-
readonly buffer: ArrayBuffer;
2440+
readonly buffer: ArrayBufferLike;
24332441

24342442
/**
24352443
* The length in bytes of the array.
@@ -2673,7 +2681,7 @@ interface Int16ArrayConstructor {
26732681
readonly prototype: Int16Array;
26742682
new (length: number): Int16Array;
26752683
new (array: ArrayLike<number>): Int16Array;
2676-
new (buffer: ArrayBuffer, byteOffset?: number, length?: number): Int16Array;
2684+
new (buffer: ArrayBufferLike, byteOffset?: number, length?: number): Int16Array;
26772685

26782686
/**
26792687
* The size in bytes of each element in the array.
@@ -2714,7 +2722,7 @@ interface Uint16Array {
27142722
/**
27152723
* The ArrayBuffer instance referenced by the array.
27162724
*/
2717-
readonly buffer: ArrayBuffer;
2725+
readonly buffer: ArrayBufferLike;
27182726

27192727
/**
27202728
* The length in bytes of the array.
@@ -2958,7 +2966,7 @@ interface Uint16ArrayConstructor {
29582966
readonly prototype: Uint16Array;
29592967
new (length: number): Uint16Array;
29602968
new (array: ArrayLike<number>): Uint16Array;
2961-
new (buffer: ArrayBuffer, byteOffset?: number, length?: number): Uint16Array;
2969+
new (buffer: ArrayBufferLike, byteOffset?: number, length?: number): Uint16Array;
29622970

29632971
/**
29642972
* The size in bytes of each element in the array.
@@ -2998,7 +3006,7 @@ interface Int32Array {
29983006
/**
29993007
* The ArrayBuffer instance referenced by the array.
30003008
*/
3001-
readonly buffer: ArrayBuffer;
3009+
readonly buffer: ArrayBufferLike;
30023010

30033011
/**
30043012
* The length in bytes of the array.
@@ -3242,7 +3250,7 @@ interface Int32ArrayConstructor {
32423250
readonly prototype: Int32Array;
32433251
new (length: number): Int32Array;
32443252
new (array: ArrayLike<number>): Int32Array;
3245-
new (buffer: ArrayBuffer, byteOffset?: number, length?: number): Int32Array;
3253+
new (buffer: ArrayBufferLike, byteOffset?: number, length?: number): Int32Array;
32463254

32473255
/**
32483256
* The size in bytes of each element in the array.
@@ -3282,7 +3290,7 @@ interface Uint32Array {
32823290
/**
32833291
* The ArrayBuffer instance referenced by the array.
32843292
*/
3285-
readonly buffer: ArrayBuffer;
3293+
readonly buffer: ArrayBufferLike;
32863294

32873295
/**
32883296
* The length in bytes of the array.
@@ -3526,7 +3534,7 @@ interface Uint32ArrayConstructor {
35263534
readonly prototype: Uint32Array;
35273535
new (length: number): Uint32Array;
35283536
new (array: ArrayLike<number>): Uint32Array;
3529-
new (buffer: ArrayBuffer, byteOffset?: number, length?: number): Uint32Array;
3537+
new (buffer: ArrayBufferLike, byteOffset?: number, length?: number): Uint32Array;
35303538

35313539
/**
35323540
* The size in bytes of each element in the array.
@@ -3566,7 +3574,7 @@ interface Float32Array {
35663574
/**
35673575
* The ArrayBuffer instance referenced by the array.
35683576
*/
3569-
readonly buffer: ArrayBuffer;
3577+
readonly buffer: ArrayBufferLike;
35703578

35713579
/**
35723580
* The length in bytes of the array.
@@ -3810,7 +3818,7 @@ interface Float32ArrayConstructor {
38103818
readonly prototype: Float32Array;
38113819
new (length: number): Float32Array;
38123820
new (array: ArrayLike<number>): Float32Array;
3813-
new (buffer: ArrayBuffer, byteOffset?: number, length?: number): Float32Array;
3821+
new (buffer: ArrayBufferLike, byteOffset?: number, length?: number): Float32Array;
38143822

38153823
/**
38163824
* The size in bytes of each element in the array.
@@ -3851,7 +3859,7 @@ interface Float64Array {
38513859
/**
38523860
* The ArrayBuffer instance referenced by the array.
38533861
*/
3854-
readonly buffer: ArrayBuffer;
3862+
readonly buffer: ArrayBufferLike;
38553863

38563864
/**
38573865
* The length in bytes of the array.
@@ -4095,7 +4103,7 @@ interface Float64ArrayConstructor {
40954103
readonly prototype: Float64Array;
40964104
new (length: number): Float64Array;
40974105
new (array: ArrayLike<number>): Float64Array;
4098-
new (buffer: ArrayBuffer, byteOffset?: number, length?: number): Float64Array;
4106+
new (buffer: ArrayBufferLike, byteOffset?: number, length?: number): Float64Array;
40994107

41004108
/**
41014109
* The size in bytes of each element in the array.

lib/lib.es2015.iterable.d.ts

+71-7
Original file line numberDiff line numberDiff line change
@@ -52,17 +52,17 @@ interface Array<T> {
5252
[Symbol.iterator](): IterableIterator<T>;
5353

5454
/**
55-
* Returns an array of key, value pairs for every entry in the array
55+
* Returns an iterable of key, value pairs for every entry in the array
5656
*/
5757
entries(): IterableIterator<[number, T]>;
5858

5959
/**
60-
* Returns an list of keys in the array
60+
* Returns an iterable of keys in the array
6161
*/
6262
keys(): IterableIterator<number>;
6363

6464
/**
65-
* Returns an list of values in the array
65+
* Returns an iterable of values in the array
6666
*/
6767
values(): IterableIterator<T>;
6868
}
@@ -86,21 +86,21 @@ interface ArrayConstructor {
8686
}
8787

8888
interface ReadonlyArray<T> {
89-
/** Iterator */
89+
/** Iterator of values in the array. */
9090
[Symbol.iterator](): IterableIterator<T>;
9191

9292
/**
93-
* Returns an array of key, value pairs for every entry in the array
93+
* Returns an iterable of key, value pairs for every entry in the array
9494
*/
9595
entries(): IterableIterator<[number, T]>;
9696

9797
/**
98-
* Returns an list of keys in the array
98+
* Returns an iterable of keys in the array
9999
*/
100100
keys(): IterableIterator<number>;
101101

102102
/**
103-
* Returns an list of values in the array
103+
* Returns an iterable of values in the array
104104
*/
105105
values(): IterableIterator<T>;
106106
}
@@ -111,9 +111,42 @@ interface IArguments {
111111
}
112112

113113
interface Map<K, V> {
114+
/** Returns an iterable of entries in the map. */
114115
[Symbol.iterator](): IterableIterator<[K, V]>;
116+
117+
/**
118+
* Returns an iterable of key, value pairs for every entry in the map.
119+
*/
115120
entries(): IterableIterator<[K, V]>;
121+
122+
/**
123+
* Returns an iterable of keys in the map
124+
*/
116125
keys(): IterableIterator<K>;
126+
127+
/**
128+
* Returns an iterable of values in the map
129+
*/
130+
values(): IterableIterator<V>;
131+
}
132+
133+
interface ReadonlyMap<K, V> {
134+
/** Returns an iterable of entries in the map. */
135+
[Symbol.iterator](): IterableIterator<[K, V]>;
136+
137+
/**
138+
* Returns an iterable of key, value pairs for every entry in the map.
139+
*/
140+
entries(): IterableIterator<[K, V]>;
141+
142+
/**
143+
* Returns an iterable of keys in the map
144+
*/
145+
keys(): IterableIterator<K>;
146+
147+
/**
148+
* Returns an iterable of values in the map
149+
*/
117150
values(): IterableIterator<V>;
118151
}
119152

@@ -128,9 +161,40 @@ interface WeakMapConstructor {
128161
}
129162

130163
interface Set<T> {
164+
/** Iterates over values in the set. */
165+
[Symbol.iterator](): IterableIterator<T>;
166+
/**
167+
* Returns an iterable of [v,v] pairs for every value `v` in the set.
168+
*/
169+
entries(): IterableIterator<[T, T]>;
170+
/**
171+
* Despite its name, returns an iterable of the values in the set,
172+
*/
173+
keys(): IterableIterator<T>;
174+
175+
/**
176+
* Returns an iterable of values in the set.
177+
*/
178+
values(): IterableIterator<T>;
179+
}
180+
181+
interface ReadonlySet<T> {
182+
/** Iterates over values in the set. */
131183
[Symbol.iterator](): IterableIterator<T>;
184+
185+
/**
186+
* Returns an iterable of [v,v] pairs for every value `v` in the set.
187+
*/
132188
entries(): IterableIterator<[T, T]>;
189+
190+
/**
191+
* Despite its name, returns an iterable of the values in the set,
192+
*/
133193
keys(): IterableIterator<T>;
194+
195+
/**
196+
* Returns an iterable of values in the set.
197+
*/
134198
values(): IterableIterator<T>;
135199
}
136200

0 commit comments

Comments
 (0)