Skip to content

Change return type of window.open to Window | null (#18132) #291

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Sep 7, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,9 @@ The common steps to send a pull request are:

0. Open or refer to an issue in the [TypeScript repo](https://github.com/Microsoft/TypeScript).
1. Add missing elements to `inputfiles/addedTypes.json`, overriding elements to `inputfiles/overridingTypes.json`, or elements to remove to `inputfiles/removedTypes.json`.
2. Run the script locally to obtain new `dom.generated.d.ts` and `webworker.generated.d.ts`.
3. Update the files in the `baselines` folder using the newly generated files.
2. Run the build script locally to obtain new `dom.generated.d.ts` and `webworker.generated.d.ts`.
3. Update the files in the `baselines` folder using the newly generated files
under `generated` folder (`cp ./generated/* ./baseline/`).

### When should a DOM API be included here?

Expand Down
4 changes: 2 additions & 2 deletions baselines/dom.generated.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13277,7 +13277,7 @@ interface Window extends EventTarget, WindowTimers, WindowSessionStorage, Window
moveBy(x?: number, y?: number): void;
moveTo(x?: number, y?: number): void;
msWriteProfilerMark(profilerMarkName: string): void;
open(url?: string, target?: string, features?: string, replace?: boolean): Window;
open(url?: string, target?: string, features?: string, replace?: boolean): Window | null;
postMessage(message: any, targetOrigin: string, transfer?: any[]): void;
print(): void;
prompt(message?: string, _default?: string): string | null;
Expand Down Expand Up @@ -14677,7 +14677,7 @@ declare function matchMedia(mediaQuery: string): MediaQueryList;
declare function moveBy(x?: number, y?: number): void;
declare function moveTo(x?: number, y?: number): void;
declare function msWriteProfilerMark(profilerMarkName: string): void;
declare function open(url?: string, target?: string, features?: string, replace?: boolean): Window;
declare function open(url?: string, target?: string, features?: string, replace?: boolean): Window | null;
declare function postMessage(message: any, targetOrigin: string, transfer?: any[]): void;
declare function print(): void;
declare function prompt(message?: string, _default?: string): string | null;
Expand Down
2 changes: 1 addition & 1 deletion inputfiles/overridingTypes.json
Original file line number Diff line number Diff line change
Expand Up @@ -615,7 +615,7 @@
"kind": "method",
"interface": "Window",
"name": "open",
"signatures": ["open(url?: string, target?: string, features?: string, replace?: boolean): Window"]
"signatures": ["open(url?: string, target?: string, features?: string, replace?: boolean): Window | null"]
},
{
"kind": "method",
Expand Down