fix(node): add undefined return to url in inspector (#35204)

This commit fixes the return type of the `url` function from the `inspector` Node module. The value `undefined` is returned when there is no active inspector.
This commit is contained in:
Charles Samborski
2019-05-30 10:59:04 -07:00
committed by Sheetal Nandi
parent b3c4e2af48
commit b6ff9c2306
11 changed files with 17 additions and 17 deletions
+2 -2
View File
@@ -3251,7 +3251,7 @@ declare module "inspector" {
function close(): void;
/**
* Return the URL of the active inspector, or undefined if there is none.
* Return the URL of the active inspector, or `undefined` if there is none.
*/
function url(): string;
function url(): string | undefined;
}
+1 -1
View File
@@ -1090,7 +1090,7 @@ import * as constants from 'constants';
inspector.open(0, 'localhost');
inspector.open(0, 'localhost', true);
inspector.close();
const inspectorUrl: string = inspector.url();
const inspectorUrl: string | undefined = inspector.url();
const session = new inspector.Session();
session.connect();
@@ -73,7 +73,7 @@ declare module "inspector" {
function close(): void;
/**
* Return the URL of the active inspector, or undefined if there is none.
* Return the URL of the active inspector, or `undefined` if there is none.
*/
function url(): string;
function url(): string | undefined;
}
+2 -2
View File
@@ -3156,7 +3156,7 @@ declare module "inspector" {
function close(): void;
/**
* Return the URL of the active inspector, or undefined if there is none.
* Return the URL of the active inspector, or `undefined` if there is none.
*/
function url(): string;
function url(): string | undefined;
}
+1 -1
View File
@@ -4822,7 +4822,7 @@ import * as constants from 'constants';
inspector.open(0, 'localhost');
inspector.open(0, 'localhost', true);
inspector.close();
const inspectorUrl: string = inspector.url();
const inspectorUrl: string | undefined = inspector.url();
const session = new inspector.Session();
session.connect();
+2 -2
View File
@@ -3251,7 +3251,7 @@ declare module "inspector" {
function close(): void;
/**
* Return the URL of the active inspector, or undefined if there is none.
* Return the URL of the active inspector, or `undefined` if there is none.
*/
function url(): string;
function url(): string | undefined;
}
+1 -1
View File
@@ -1090,7 +1090,7 @@ import * as constants from 'constants';
inspector.open(0, 'localhost');
inspector.open(0, 'localhost', true);
inspector.close();
const inspectorUrl: string = inspector.url();
const inspectorUrl: string | undefined = inspector.url();
const session = new inspector.Session();
session.connect();
+2 -2
View File
@@ -2506,7 +2506,7 @@ declare module "inspector" {
export function close(): void;
/**
* Return the URL of the active inspector, or undefined if there is none.
* Return the URL of the active inspector, or `undefined` if there is none.
*/
export function url(): string;
export function url(): string | undefined;
}
+1 -1
View File
@@ -4041,7 +4041,7 @@ namespace inspector_tests {
inspector.open(0, 'localhost');
inspector.open(0, 'localhost', true);
inspector.close();
const inspectorUrl: string = inspector.url();
const inspectorUrl: string | undefined = inspector.url();
const session = new inspector.Session();
session.connect();
+2 -2
View File
@@ -2524,7 +2524,7 @@ declare module "inspector" {
export function close(): void;
/**
* Return the URL of the active inspector, or undefined if there is none.
* Return the URL of the active inspector, or `undefined` if there is none.
*/
export function url(): string;
export function url(): string | undefined;
}
+1 -1
View File
@@ -4106,7 +4106,7 @@ namespace inspector_tests {
inspector.open(0, 'localhost');
inspector.open(0, 'localhost', true);
inspector.close();
const inspectorUrl: string = inspector.url();
const inspectorUrl: string | undefined = inspector.url();
const session = new inspector.Session();
session.connect();