Skip to content

Commit e910e71

Browse files
author
Kanchalai Tanglertsampan
committed
Merge branch 'master' into fix4211
2 parents f4290e1 + 322126d commit e910e71

File tree

788 files changed

+130900
-16570
lines changed

Some content is hidden

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

788 files changed

+130900
-16570
lines changed

CONTRIBUTING.md

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,45 @@
1+
# Instructions for Logging Issues
2+
3+
## 1. Read the FAQ
4+
5+
Please [read the FAQ](https://github.com/Microsoft/TypeScript/wiki/FAQ) before logging new issues, even if you think you have found a bug.
6+
7+
Issues that ask questions answered in the FAQ will be closed without elaboration.
8+
9+
## 2. Search for Duplicates
10+
11+
[Search the existing issues](https://github.com/Microsoft/TypeScript/issues?utf8=%E2%9C%93&q=is%3Aissue) before logging a new one.
12+
13+
## 3. Do you have a question?
14+
15+
The issue tracker is for **issues**, in other words, bugs and suggestions.
16+
If you have a *question*, please use [http://stackoverflow.com/questions/tagged/typescript](Stack Overflow), [https://gitter.im/Microsoft/TypeScript](Gitter), your favorite search engine, or other resources.
17+
Due to increased traffic, we can no longer answer questions in the issue tracker.
18+
19+
## 4. Did you find a bug?
20+
21+
When logging a bug, please be sure to include the following:
22+
* What version of TypeScript you're using (run `tsc --v`)
23+
* If at all possible, an *isolated* way to reproduce the behavior
24+
* The behavior you expect to see, and the actual behavior
25+
26+
You can try out the nightly build of TypeScript (`npm install typescript@next`) to see if the bug has already been fixed.
27+
28+
## 5. Do you have a suggestion?
29+
30+
We also accept suggestions in the issue tracker.
31+
Be sure to [check the FAQ](https://github.com/Microsoft/TypeScript/wiki/FAQ) and [search](https://github.com/Microsoft/TypeScript/issues?utf8=%E2%9C%93&q=is%3Aissue) first.
32+
33+
In general, things we find useful when reviewing suggestins are:
34+
* A description of the problem you're trying to solve
35+
* An overview of the suggested solution
36+
* Examples of how the suggestion would work in various places
37+
* Code examples showing e.g. "this would be an error, this wouldn't"
38+
* Code examples showing the generated JavaScript (if applicable)
39+
* If relevant, precedent in other languages can be useful for establishing context and expected behavior
40+
41+
# Instructions for Contributing Code
42+
143
## Contributing bug fixes
244

345
TypeScript is currently accepting contributions in the form of bug fixes. A bug must have an issue tracking it in the issue tracker that has been approved ("Milestone == Community") by the TypeScript team. Your pull request should include a link to the bug that you are fixing. If you've submitted a PR for a bug, please post a comment in the bug to avoid duplication of effort.

Jakefile.js

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -163,13 +163,15 @@ var harnessSources = harnessCoreSources.concat([
163163
}));
164164

165165
var librarySourceMap = [
166-
{ target: "lib.core.d.ts", sources: ["core.d.ts"] },
166+
{ target: "lib.core.d.ts", sources: ["header.d.ts", "core.d.ts"] },
167167
{ target: "lib.dom.d.ts", sources: ["importcore.d.ts", "intl.d.ts", "dom.generated.d.ts"], },
168168
{ target: "lib.webworker.d.ts", sources: ["importcore.d.ts", "intl.d.ts", "webworker.generated.d.ts"], },
169169
{ target: "lib.scriptHost.d.ts", sources: ["importcore.d.ts", "scriptHost.d.ts"], },
170-
{ target: "lib.d.ts", sources: ["core.d.ts", "intl.d.ts", "dom.generated.d.ts", "webworker.importscripts.d.ts", "scriptHost.d.ts"], },
171-
{ target: "lib.core.es6.d.ts", sources: ["core.d.ts", "es6.d.ts"]},
172-
{ target: "lib.es6.d.ts", sources: ["es6.d.ts", "core.d.ts", "intl.d.ts", "dom.generated.d.ts", "dom.es6.d.ts", "webworker.importscripts.d.ts", "scriptHost.d.ts"] }
170+
{ target: "lib.d.ts", sources: ["header.d.ts", "core.d.ts", "intl.d.ts", "dom.generated.d.ts", "webworker.importscripts.d.ts", "scriptHost.d.ts"], },
171+
{ target: "lib.core.es6.d.ts", sources: ["header.d.ts", "core.d.ts", "es6.d.ts"]},
172+
{ target: "lib.es6.d.ts", sources: ["header.d.ts", "es6.d.ts", "core.d.ts", "intl.d.ts", "dom.generated.d.ts", "dom.es6.d.ts", "webworker.importscripts.d.ts", "scriptHost.d.ts"] },
173+
{ target: "lib.core.es7.d.ts", sources: ["header.d.ts", "core.d.ts", "es6.d.ts", "es7.d.ts"]},
174+
{ target: "lib.es7.d.ts", sources: ["header.d.ts", "es6.d.ts", "es7.d.ts", "core.d.ts", "intl.d.ts", "dom.generated.d.ts", "dom.es6.d.ts", "webworker.importscripts.d.ts", "scriptHost.d.ts"] }
173175
];
174176

175177
var libraryTargets = librarySourceMap.map(function (f) {
@@ -893,6 +895,7 @@ function getLinterOptions() {
893895

894896
function lintFileContents(options, path, contents) {
895897
var ll = new Linter(path, contents, options);
898+
console.log("Linting '" + path + "'.")
896899
return ll.lint();
897900
}
898901

564 Bytes
Binary file not shown.

doc/spec.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3885,7 +3885,7 @@ function g(x: number) {
38853885
38863886
the inferred return type for 'f' and 'g' is Any because the functions reference themselves through a cycle with no return type annotations. Adding an explicit return type 'number' to either breaks the cycle and causes the return type 'number' to be inferred for the other.
38873887
3888-
An explicitly typed function whose return type isn't the Void or the Any type must have at least one return statement somewhere in its body. An exception to this rule is if the function implementation consists of a single 'throw' statement.
3888+
An explicitly typed function whose return type isn't the Void type, the Any type, or a union type containing the Void or Any type as a constituent must have at least one return statement somewhere in its body. An exception to this rule is if the function implementation consists of a single 'throw' statement.
38893889
38903890
The type of 'this' in a function implementation is the Any type.
38913891

lib/lib.core.d.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ and limitations under the License.
1414
***************************************************************************** */
1515

1616
/// <reference no-default-lib="true"/>
17-
1817
/////////////////////////////
1918
/// ECMAScript APIs
2019
/////////////////////////////

lib/lib.core.es6.d.ts

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ and limitations under the License.
1414
***************************************************************************** */
1515

1616
/// <reference no-default-lib="true"/>
17-
1817
/////////////////////////////
1918
/// ECMAScript APIs
2019
/////////////////////////////
@@ -5121,15 +5120,15 @@ interface PromiseConstructor {
51215120
* @param values An array of Promises.
51225121
* @returns A new Promise.
51235122
*/
5124-
all<T1, T2>(values: [T1 | PromiseLike<T1>, T2 | PromiseLike<T2>]): Promise<[T1, T2]>;
5125-
all<T1, T2, T3>(values: [T1 | PromiseLike<T1>, T2 | PromiseLike<T2>, T3 | PromiseLike<T3>]): Promise<[T1, T2, T3]>;
5126-
all<T1, T2, T3, T4>(values: [T1 | PromiseLike<T1>, T2 | PromiseLike<T2>, T3 | PromiseLike<T3>, T4 | PromiseLike <T4>]): Promise<[T1, T2, T3, T4]>;
5127-
all<T1, T2, T3, T4, T5>(values: [T1 | PromiseLike<T1>, T2 | PromiseLike<T2>, T3 | PromiseLike<T3>, T4 | PromiseLike <T4>, T5 | PromiseLike<T5>]): Promise<[T1, T2, T3, T4, T5]>;
5128-
all<T1, T2, T3, T4, T5, T6>(values: [T1 | PromiseLike<T1>, T2 | PromiseLike<T2>, T3 | PromiseLike<T3>, T4 | PromiseLike <T4>, T5 | PromiseLike<T5>, T6 | PromiseLike<T6>]): Promise<[T1, T2, T3, T4, T5, T6]>;
5129-
all<T1, T2, T3, T4, T5, T6, T7>(values: [T1 | PromiseLike<T1>, T2 | PromiseLike<T2>, T3 | PromiseLike<T3>, T4 | PromiseLike <T4>, T5 | PromiseLike<T5>, T6 | PromiseLike<T6>, T7 | PromiseLike<T7>]): Promise<[T1, T2, T3, T4, T5, T6, T7]>;
5130-
all<T1, T2, T3, T4, T5, T6, T7, T8>(values: [T1 | PromiseLike<T1>, T2 | PromiseLike<T2>, T3 | PromiseLike<T3>, T4 | PromiseLike <T4>, T5 | PromiseLike<T5>, T6 | PromiseLike<T6>, T7 | PromiseLike<T7>, T8 | PromiseLike<T8>]): Promise<[T1, T2, T3, T4, T5, T6, T7, T8]>;
5131-
all<T1, T2, T3, T4, T5, T6, T7, T8, T9>(values: [T1 | PromiseLike<T1>, T2 | PromiseLike<T2>, T3 | PromiseLike<T3>, T4 | PromiseLike <T4>, T5 | PromiseLike<T5>, T6 | PromiseLike<T6>, T7 | PromiseLike<T7>, T8 | PromiseLike<T8>, T9 | PromiseLike<T9>]): Promise<[T1, T2, T3, T4, T5, T6, T7, T8, T9]>;
51325123
all<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>(values: [T1 | PromiseLike<T1>, T2 | PromiseLike<T2>, T3 | PromiseLike<T3>, T4 | PromiseLike <T4>, T5 | PromiseLike<T5>, T6 | PromiseLike<T6>, T7 | PromiseLike<T7>, T8 | PromiseLike<T8>, T9 | PromiseLike<T9>, T10 | PromiseLike<T10>]): Promise<[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10]>;
5124+
all<T1, T2, T3, T4, T5, T6, T7, T8, T9>(values: [T1 | PromiseLike<T1>, T2 | PromiseLike<T2>, T3 | PromiseLike<T3>, T4 | PromiseLike <T4>, T5 | PromiseLike<T5>, T6 | PromiseLike<T6>, T7 | PromiseLike<T7>, T8 | PromiseLike<T8>, T9 | PromiseLike<T9>]): Promise<[T1, T2, T3, T4, T5, T6, T7, T8, T9]>;
5125+
all<T1, T2, T3, T4, T5, T6, T7, T8>(values: [T1 | PromiseLike<T1>, T2 | PromiseLike<T2>, T3 | PromiseLike<T3>, T4 | PromiseLike <T4>, T5 | PromiseLike<T5>, T6 | PromiseLike<T6>, T7 | PromiseLike<T7>, T8 | PromiseLike<T8>]): Promise<[T1, T2, T3, T4, T5, T6, T7, T8]>;
5126+
all<T1, T2, T3, T4, T5, T6, T7>(values: [T1 | PromiseLike<T1>, T2 | PromiseLike<T2>, T3 | PromiseLike<T3>, T4 | PromiseLike <T4>, T5 | PromiseLike<T5>, T6 | PromiseLike<T6>, T7 | PromiseLike<T7>]): Promise<[T1, T2, T3, T4, T5, T6, T7]>;
5127+
all<T1, T2, T3, T4, T5, T6>(values: [T1 | PromiseLike<T1>, T2 | PromiseLike<T2>, T3 | PromiseLike<T3>, T4 | PromiseLike <T4>, T5 | PromiseLike<T5>, T6 | PromiseLike<T6>]): Promise<[T1, T2, T3, T4, T5, T6]>;
5128+
all<T1, T2, T3, T4, T5>(values: [T1 | PromiseLike<T1>, T2 | PromiseLike<T2>, T3 | PromiseLike<T3>, T4 | PromiseLike <T4>, T5 | PromiseLike<T5>]): Promise<[T1, T2, T3, T4, T5]>;
5129+
all<T1, T2, T3, T4>(values: [T1 | PromiseLike<T1>, T2 | PromiseLike<T2>, T3 | PromiseLike<T3>, T4 | PromiseLike <T4>]): Promise<[T1, T2, T3, T4]>;
5130+
all<T1, T2, T3>(values: [T1 | PromiseLike<T1>, T2 | PromiseLike<T2>, T3 | PromiseLike<T3>]): Promise<[T1, T2, T3]>;
5131+
all<T1, T2>(values: [T1 | PromiseLike<T1>, T2 | PromiseLike<T2>]): Promise<[T1, T2]>;
51335132
all<TAll>(values: Iterable<TAll | PromiseLike<TAll>>): Promise<TAll[]>;
51345133

51355134
/**

lib/lib.d.ts

Lines changed: 32 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ and limitations under the License.
1414
***************************************************************************** */
1515

1616
/// <reference no-default-lib="true"/>
17-
1817
/////////////////////////////
1918
/// ECMAScript APIs
2019
/////////////////////////////
@@ -5296,7 +5295,7 @@ interface Console {
52965295
select(element: Element): void;
52975296
time(timerName?: string): void;
52985297
timeEnd(timerName?: string): void;
5299-
trace(): void;
5298+
trace(message?: any, ...optionalParams: any[]): void;
53005299
warn(message?: any, ...optionalParams: any[]): void;
53015300
}
53025301

@@ -5555,9 +5554,9 @@ interface DataTransferItemList {
55555554
length: number;
55565555
add(data: File): DataTransferItem;
55575556
clear(): void;
5558-
item(index: number): File;
5557+
item(index: number): DataTransferItem;
55595558
remove(index: number): void;
5560-
[index: number]: File;
5559+
[index: number]: DataTransferItem;
55615560
}
55625561

55635562
declare var DataTransferItemList: {
@@ -6610,6 +6609,8 @@ interface Document extends Node, GlobalEventHandlers, NodeSelector, DocumentEven
66106609
* @param content The text and HTML tags to write.
66116610
*/
66126611
writeln(...content: string[]): void;
6612+
createElement(tagName: "picture"): HTMLPictureElement;
6613+
getElementsByTagName(tagname: "picture"): NodeListOf<HTMLPictureElement>;
66136614
addEventListener(type: "MSContentZoom", listener: (ev: UIEvent) => any, useCapture?: boolean): void;
66146615
addEventListener(type: "MSGestureChange", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void;
66156616
addEventListener(type: "MSGestureDoubleTap", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void;
@@ -7022,6 +7023,7 @@ interface Element extends Node, GlobalEventHandlers, ElementTraversal, NodeSelec
70227023
webkitRequestFullscreen(): void;
70237024
getElementsByClassName(classNames: string): NodeListOf<Element>;
70247025
matches(selector: string): boolean;
7026+
getElementsByTagName(tagname: "picture"): NodeListOf<HTMLPictureElement>;
70257027
addEventListener(type: "MSGestureChange", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void;
70267028
addEventListener(type: "MSGestureDoubleTap", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void;
70277029
addEventListener(type: "MSGestureEnd", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void;
@@ -7811,6 +7813,7 @@ interface HTMLCanvasElement extends HTMLElement {
78117813
* @param type The standard MIME type for the image format to return. If you do not specify this parameter, the default value is a PNG format image.
78127814
*/
78137815
toDataURL(type?: string, ...args: any[]): string;
7816+
toBlob(): Blob;
78147817
}
78157818

78167819
declare var HTMLCanvasElement: {
@@ -10965,7 +10968,7 @@ interface IDBDatabase extends EventTarget {
1096510968
objectStoreNames: DOMStringList;
1096610969
onabort: (ev: Event) => any;
1096710970
onerror: (ev: Event) => any;
10968-
version: string;
10971+
version: number;
1096910972
close(): void;
1097010973
createObjectStore(name: string, optionalParameters?: IDBObjectStoreParameters): IDBObjectStore;
1097110974
deleteObjectStore(name: string): void;
@@ -11681,7 +11684,7 @@ declare var MediaQueryList: {
1168111684
interface MediaSource extends EventTarget {
1168211685
activeSourceBuffers: SourceBufferList;
1168311686
duration: number;
11684-
readyState: number;
11687+
readyState: string;
1168511688
sourceBuffers: SourceBufferList;
1168611689
addSourceBuffer(type: string): SourceBuffer;
1168711690
endOfStream(error?: number): void;
@@ -14410,17 +14413,16 @@ declare var Storage: {
1441014413
}
1441114414

1441214415
interface StorageEvent extends Event {
14413-
key: string;
14414-
newValue: any;
14415-
oldValue: any;
14416-
storageArea: Storage;
1441714416
url: string;
14418-
initStorageEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, keyArg: string, oldValueArg: any, newValueArg: any, urlArg: string, storageAreaArg: Storage): void;
14417+
key?: string;
14418+
oldValue?: string;
14419+
newValue?: string;
14420+
storageArea?: Storage;
1441914421
}
1442014422

1442114423
declare var StorageEvent: {
1442214424
prototype: StorageEvent;
14423-
new(): StorageEvent;
14425+
new (type: string, eventInitDict?: StorageEventInit): StorageEvent;
1442414426
}
1442514427

1442614428
interface StyleMedia {
@@ -16018,7 +16020,7 @@ interface Window extends EventTarget, WindowTimers, WindowSessionStorage, Window
1601816020
msMatchMedia(mediaQuery: string): MediaQueryList;
1601916021
msRequestAnimationFrame(callback: FrameRequestCallback): number;
1602016022
msWriteProfilerMark(profilerMarkName: string): void;
16021-
open(url?: string, target?: string, features?: string, replace?: boolean): any;
16023+
open(url?: string, target?: string, features?: string, replace?: boolean): Window;
1602216024
postMessage(message: any, targetOrigin: string, ports?: any): void;
1602316025
print(): void;
1602416026
prompt(message?: string, _default?: string): string;
@@ -16620,6 +16622,14 @@ interface XMLHttpRequestEventTarget {
1662016622
addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
1662116623
}
1662216624

16625+
interface StorageEventInit extends EventInit {
16626+
key?: string;
16627+
oldValue?: string;
16628+
newValue?: string;
16629+
url: string;
16630+
storageArea?: Storage;
16631+
}
16632+
1662316633
interface IDBObjectStoreParameters {
1662416634
keyPath?: string | string[];
1662516635
autoIncrement?: boolean;
@@ -16674,6 +16684,14 @@ declare var HTMLTemplateElement: {
1667416684
new(): HTMLTemplateElement;
1667516685
}
1667616686

16687+
interface HTMLPictureElement extends HTMLElement {
16688+
}
16689+
16690+
declare var HTMLPictureElement: {
16691+
prototype: HTMLPictureElement;
16692+
new(): HTMLPictureElement;
16693+
}
16694+
1667716695
declare type EventListenerOrEventListenerObject = EventListener | EventListenerObject;
1667816696

1667916697
interface ErrorEventHandler {
@@ -16870,7 +16888,7 @@ declare function msCancelRequestAnimationFrame(handle: number): void;
1687016888
declare function msMatchMedia(mediaQuery: string): MediaQueryList;
1687116889
declare function msRequestAnimationFrame(callback: FrameRequestCallback): number;
1687216890
declare function msWriteProfilerMark(profilerMarkName: string): void;
16873-
declare function open(url?: string, target?: string, features?: string, replace?: boolean): any;
16891+
declare function open(url?: string, target?: string, features?: string, replace?: boolean): Window;
1687416892
declare function postMessage(message: any, targetOrigin: string, ports?: any): void;
1687516893
declare function print(): void;
1687616894
declare function prompt(message?: string, _default?: string): string;

0 commit comments

Comments
 (0)