From 1587c59d0a157cfb083cd79a4d17053e12c8f2c7 Mon Sep 17 00:00:00 2001 From: Gora Kong Date: Thu, 19 Nov 2020 17:49:13 -0800 Subject: [PATCH 1/4] libdefs: add typings for node's built-in Module module --- lib/node.js | 62 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) diff --git a/lib/node.js b/lib/node.js index 1666c72b0d0..7fc55454aab 100644 --- a/lib/node.js +++ b/lib/node.js @@ -1654,6 +1654,68 @@ type net$connectOptions = { ... }; +declare module "module" { + declare type FilePath = string; + + declare class Module { + constructor(id: FilePath, parent?: Module): void; + id: string; + path: FilePath; + paths: FilePath[]; + exports: {|[export: string]: mixed|}; + filename: string; + loaded: boolean; + children: Module[]; + globalPaths: FilePath[]; + load(fileName: string): void; + require: (request: string) => {|[export: string]: mixed|}; + syncBuiltinESMExports(): void; + + static runMain(): void; + static wrap(code: string): string; + + /** + * Deprecated since: v12.2.0. Please use createRequire() instead. + */ + static createRequireFromPath(path: string): (request: string) => {|[export: string]: mixed|}; + static createRequire(path: string | URL): (request: string) => {|[export: string]: mixed|}; + static builtinModules: string[]; + static _cache: {|[key: FilePath]: Module|}; + static _pathCache: {|[cacheKey: string]: FilePath|}; + static _nodeModulePaths(from: FilePath): FilePath[]; + static _initPaths(): void; + static findPnpApi(lookupSource: string): PnpApi | null; + + static _findPath( + request: FilePath, + paths: FilePath[], + isMain: boolean, + ): FilePath | false; + + static _extensions: {| + [extension: string]: (module: Module, fileName: string) => void, + |}; + + static _resolveLookupPaths( + request: FilePath, + parent: Module, + ): FilePath[] | null; + + static _load( + request: FilePath, + parent: Module, + isMain: boolean, + ): {|[export: string]: mixed|}; + + static _resolveFilename: ( + request: string, + parent?: Module, + isMain?: boolean, + options?: {|paths?: FilePath[]|}, + ) => string | false; + } +} + declare module "net" { declare class Server extends net$Server {} From 740c4b11f789b55863acda7527eb29bcb39131a0 Mon Sep 17 00:00:00 2001 From: Gora Kong Date: Tue, 8 Dec 2020 16:23:35 -0800 Subject: [PATCH 2/4] tests wip --- lib/core.js | 8 ++++--- lib/node.js | 39 +++++++++++-------------------- tests/node_tests/module/module.js | 7 ++++++ 3 files changed, 26 insertions(+), 28 deletions(-) create mode 100644 tests/node_tests/module/module.js diff --git a/lib/core.js b/lib/core.js index 1d6ce0c869f..6c746ffb2bb 100644 --- a/lib/core.js +++ b/lib/core.js @@ -2399,9 +2399,11 @@ declare var module: { id: string, filename: string, loaded: boolean, - parent: any, - children: Array, - builtinModules: Array, + parent?: typeof module, + children: typeof module[], + builtinModules: string[], + path: string; + paths: string[]; ... }; declare var require: { diff --git a/lib/node.js b/lib/node.js index 7fc55454aab..3826408c39e 100644 --- a/lib/node.js +++ b/lib/node.js @@ -853,7 +853,6 @@ declare class events$EventEmitter { rawListeners(event: string): Array; } - declare module "events" { // TODO: See the comment above the events$EventEmitter declaration declare class EventEmitter extends events$EventEmitter { @@ -1655,20 +1654,10 @@ type net$connectOptions = { }; declare module "module" { - declare type FilePath = string; - - declare class Module { - constructor(id: FilePath, parent?: Module): void; - id: string; - path: FilePath; - paths: FilePath[]; - exports: {|[export: string]: mixed|}; - filename: string; - loaded: boolean; - children: Module[]; - globalPaths: FilePath[]; + declare export class Module extends module { + constructor(id: string, parent?: typeof module): void; + globalPaths: string[]; load(fileName: string): void; - require: (request: string) => {|[export: string]: mixed|}; syncBuiltinESMExports(): void; static runMain(): void; @@ -1679,30 +1668,29 @@ declare module "module" { */ static createRequireFromPath(path: string): (request: string) => {|[export: string]: mixed|}; static createRequire(path: string | URL): (request: string) => {|[export: string]: mixed|}; - static builtinModules: string[]; - static _cache: {|[key: FilePath]: Module|}; - static _pathCache: {|[cacheKey: string]: FilePath|}; - static _nodeModulePaths(from: FilePath): FilePath[]; + static _cache: {|[key: string]: Module|}; + static _pathCache: {|[cacheKey: string]: string|}; + static _nodeModulePaths(from: string): string[]; static _initPaths(): void; static findPnpApi(lookupSource: string): PnpApi | null; static _findPath( - request: FilePath, - paths: FilePath[], + request: string, + paths: string[], isMain: boolean, - ): FilePath | false; + ): string | false; static _extensions: {| [extension: string]: (module: Module, fileName: string) => void, |}; static _resolveLookupPaths( - request: FilePath, + request: string, parent: Module, - ): FilePath[] | null; + ): string[] | null; static _load( - request: FilePath, + request: string, parent: Module, isMain: boolean, ): {|[export: string]: mixed|}; @@ -1711,7 +1699,7 @@ declare module "module" { request: string, parent?: Module, isMain?: boolean, - options?: {|paths?: FilePath[]|}, + options?: {|paths?: string[]|}, ) => string | false; } } @@ -2623,6 +2611,7 @@ declare module "v8" { declare function getHeapStatistics() : HeapStatistics; declare function getHeapSpaceStatistics() : Array declare function setFlagsFromString(flags: string) : void; + declare function deserialize(buffer: Buffer): mixed; } type repl$DefineCommandOptions = diff --git a/tests/node_tests/module/module.js b/tests/node_tests/module/module.js new file mode 100644 index 00000000000..f8a82134a63 --- /dev/null +++ b/tests/node_tests/module/module.js @@ -0,0 +1,7 @@ +/* @flow */ +const Module = require('module'); + +const module: Module = new Module('foo'); + +module.load('bar'); +module.load(1); // error \ No newline at end of file From 184b5905138c52f4ba25f2001d9537893870ca26 Mon Sep 17 00:00:00 2001 From: Gora Kong Date: Wed, 9 Dec 2020 17:59:03 -0800 Subject: [PATCH 3/4] tests --- lib/node.js | 20 +- tests/node_tests/module/module.js | 35 +- tests/node_tests/node_tests.exp | 617 ++++++++++++++++++------------ 3 files changed, 406 insertions(+), 266 deletions(-) diff --git a/lib/node.js b/lib/node.js index 3826408c39e..fb491edda4e 100644 --- a/lib/node.js +++ b/lib/node.js @@ -1654,7 +1654,7 @@ type net$connectOptions = { }; declare module "module" { - declare export class Module extends module { + declare class Module extends module { constructor(id: string, parent?: typeof module): void; globalPaths: string[]; load(fileName: string): void; @@ -1666,8 +1666,8 @@ declare module "module" { /** * Deprecated since: v12.2.0. Please use createRequire() instead. */ - static createRequireFromPath(path: string): (request: string) => {|[export: string]: mixed|}; - static createRequire(path: string | URL): (request: string) => {|[export: string]: mixed|}; + static createRequireFromPath(path: string): (request: string) => {|[export: string]: any|}; + static createRequire(path: string | URL): (request: string) => {|[export: string]: any|}; static _cache: {|[key: string]: Module|}; static _pathCache: {|[cacheKey: string]: string|}; static _nodeModulePaths(from: string): string[]; @@ -1676,8 +1676,8 @@ declare module "module" { static _findPath( request: string, - paths: string[], - isMain: boolean, + paths?: string[], + isMain?: boolean, ): string | false; static _extensions: {| @@ -1686,14 +1686,14 @@ declare module "module" { static _resolveLookupPaths( request: string, - parent: Module, + parent?: Module, ): string[] | null; static _load( request: string, - parent: Module, - isMain: boolean, - ): {|[export: string]: mixed|}; + parent?: Module, + isMain?: boolean, + ): {|[export: string]: any|}; static _resolveFilename: ( request: string, @@ -1702,6 +1702,8 @@ declare module "module" { options?: {|paths?: string[]|}, ) => string | false; } + + declare module.exports: typeof Module; } declare module "net" { diff --git a/tests/node_tests/module/module.js b/tests/node_tests/module/module.js index f8a82134a63..5c76f4774fb 100644 --- a/tests/node_tests/module/module.js +++ b/tests/node_tests/module/module.js @@ -1,7 +1,36 @@ /* @flow */ + const Module = require('module'); -const module: Module = new Module('foo'); +const myModule = new Module('foo'); +const invalidModule = new Module(1); // error + +// Instance methods +myModule.globalPaths = ['/xyz', '/abc']; +myModule.globalPaths = [1]; // error + +myModule.load('bar.js'); +(myModule.load('a.js'): Module); // error + +// Static methods +Module._cache = {a: myModule, b: new Module('baz')}; +Module._cache = {a: 123}; // error + +Module._findPath('a', ['./bcd', '../xyz']); +Module._findPath('a', '/bcd'); // error + +let paths = Module._resolveLookupPaths('foo'); + +if (paths) { + (paths: string[]); +} else { + (paths: null); +}; + +(Module._load('file.js'): {}); +(Module._load('file.js'): {[export: string]: () => {}}); + +Module._resolveFilename('foo.js', 'bar'); // error +let filename = Module._resolveFilename('foo.js', myModule); -module.load('bar'); -module.load(1); // error \ No newline at end of file +(filename: boolean); // error diff --git a/tests/node_tests/node_tests.exp b/tests/node_tests/node_tests.exp index 4e7000f1c72..52862515fae 100644 --- a/tests/node_tests/node_tests.exp +++ b/tests/node_tests/node_tests.exp @@ -47,8 +47,8 @@ Cannot cast `hmac.read()` to number because null or undefined [1] is incompatibl ^^^^^^^^^^^ References: - /node.js:1876:24 - 1876| read(size?: number): ?(string | Buffer); + /node.js:1928:24 + 1928| read(size?: number): ?(string | Buffer); ^^^^^^^^^^^^^^^^^^ [1] crypto/crypto.js:12:21 12| (hmac.read(): number); // 4 errors: null, void, string, Buffer @@ -64,8 +64,8 @@ Cannot cast `hmac.read()` to number because string [1] is incompatible with numb ^^^^^^^^^^^ References: - /node.js:1876:26 - 1876| read(size?: number): ?(string | Buffer); + /node.js:1928:26 + 1928| read(size?: number): ?(string | Buffer); ^^^^^^ [1] crypto/crypto.js:12:21 12| (hmac.read(): number); // 4 errors: null, void, string, Buffer @@ -81,8 +81,8 @@ Cannot cast `hmac.read()` to number because `Buffer` [1] is incompatible with nu ^^^^^^^^^^^ References: - /node.js:1876:35 - 1876| read(size?: number): ?(string | Buffer); + /node.js:1928:35 + 1928| read(size?: number): ?(string | Buffer); ^^^^^^ [1] crypto/crypto.js:12:21 12| (hmac.read(): number); // 4 errors: null, void, string, Buffer @@ -103,11 +103,11 @@ References: crypto/crypto.js:16:16 16| hmac.write(123); // 2 errors: not a string or a Buffer ^^^ [1] - /node.js:1920:16 - 1920| write(chunk: string | Buffer | Uint8Array, callback?: (error?: Error) => void): boolean; + /node.js:1972:16 + 1972| write(chunk: string | Buffer | Uint8Array, callback?: (error?: Error) => void): boolean; ^^^^^^ [2] - /node.js:1921:16 - 1921| write(chunk: string | Buffer | Uint8Array, encoding?: string, callback?: (error?: Error) => void): boolean; + /node.js:1973:16 + 1973| write(chunk: string | Buffer | Uint8Array, encoding?: string, callback?: (error?: Error) => void): boolean; ^^^^^^ [3] @@ -618,11 +618,11 @@ fix add a type annotation to `_` [3] or to `data` [4]. [speculation-ambiguous] -^ References: - /node.js:1104:20 - 1104| declare function readFile( + /node.js:1103:20 + 1103| declare function readFile( ^^^^^^^^ [1] - /node.js:1113:20 - 1113| declare function readFile( + /node.js:1112:20 + 1112| declare function readFile( ^^^^^^^^ [2] fs/fs.js:13:48 13| fs.readFile("file.exp", { encoding: "blah" }, (_, data) => { @@ -641,8 +641,8 @@ Cannot cast `fs.readFileSync(...)` to string because `Buffer` [1] is incompatibl ^^^^^^^^^^^^^^^^^^^^^^^^^^^ References: - /node.js:1120:6 - 1120| ): Buffer; + /node.js:1119:6 + 1119| ): Buffer; ^^^^^^ [1] fs/fs.js:28:32 28| (fs.readFileSync("file.exp") : string); // error @@ -658,8 +658,8 @@ Cannot cast `fs.readFileSync(...)` to `Buffer` because string [1] is incompatibl ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ References: - /node.js:1124:6 - 1124| ): string; + /node.js:1123:6 + 1123| ): string; ^^^^^^ [1] fs/fs.js:31:40 31| (fs.readFileSync("file.exp", "blah") : Buffer); // error @@ -675,8 +675,8 @@ Cannot cast `fs.readFileSync(...)` to `Buffer` because string [1] is incompatibl ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ References: - /node.js:1129:7 - 1129| }): string; + /node.js:1128:7 + 1128| }): string; ^^^^^^ [1] fs/fs.js:34:54 34| (fs.readFileSync("file.exp", { encoding: "blah" }) : Buffer); // error @@ -692,8 +692,8 @@ Cannot cast `fs.readFileSync(...)` to string because `Buffer` [1] is incompatibl ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ References: - /node.js:1134:7 - 1134| }): Buffer; + /node.js:1133:7 + 1133| }): Buffer; ^^^^^^ [1] fs/fs.js:37:36 37| (fs.readFileSync("file.exp", {}) : string); // error @@ -712,8 +712,8 @@ References: http/get.js:13:10 13| http.get(-1); // error ^^ [1] - /node.js:1536:10 - 1536| url: string, + /node.js:1535:10 + 1535| url: string, ^^^^^^ [2] @@ -729,8 +729,8 @@ References: http/get.js:14:17 14| http.get({port: 'expects number'}); // error ^^^^^^^^^^^^^^^^ [1] - /node.js:1496:10 - 1496| port?: number, + /node.js:1495:10 + 1495| port?: number, ^^^^^^ [2] @@ -746,8 +746,8 @@ References: http/get.js:15:19 15| http.get(url, {}, -1); // error ^^ [1] - /node.js:1538:16 - 1538| callback?: (response: IncomingMessage) => void + /node.js:1537:16 + 1537| callback?: (response: IncomingMessage) => void ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [2] @@ -763,8 +763,8 @@ References: http/get.js:16:22 16| http.get(url, {port: 'expects number'}, () => {}); // error ^^^^^^^^^^^^^^^^ [1] - /node.js:1496:10 - 1496| port?: number, + /node.js:1495:10 + 1495| port?: number, ^^^^^^ [2] @@ -780,8 +780,8 @@ References: http/request.js:13:14 13| http.request(-1); // error ^^ [1] - /node.js:1527:10 - 1527| url: string, + /node.js:1526:10 + 1526| url: string, ^^^^^^ [2] @@ -797,8 +797,8 @@ References: http/request.js:14:21 14| http.request({port: 'expects number'}); // error ^^^^^^^^^^^^^^^^ [1] - /node.js:1496:10 - 1496| port?: number, + /node.js:1495:10 + 1495| port?: number, ^^^^^^ [2] @@ -814,8 +814,8 @@ References: http/request.js:15:23 15| http.request(url, {}, -1); // error ^^ [1] - /node.js:1529:16 - 1529| callback?: (response: IncomingMessage) => void + /node.js:1528:16 + 1528| callback?: (response: IncomingMessage) => void ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [2] @@ -831,8 +831,8 @@ References: http/request.js:16:26 16| http.request(url, {port: 'expects number'}, () => {}); // error ^^^^^^^^^^^^^^^^ [1] - /node.js:1496:10 - 1496| port?: number, + /node.js:1495:10 + 1495| port?: number, ^^^^^^ [2] @@ -848,8 +848,8 @@ References: http/server.js:69:15 69| server.listen({}, () => {}, 'localhost', 123); ^^ [1] - /node.js:1435:17 - 1435| listen(port?: number, hostname?: string, backlog?: number, callback?: Function): this; + /node.js:1434:17 + 1434| listen(port?: number, hostname?: string, backlog?: number, callback?: Function): this; ^^^^^^ [2] @@ -865,8 +865,8 @@ References: http/server.js:70:15 70| server.listen({}, function() {}, 'localhost', 123); ^^ [1] - /node.js:1435:17 - 1435| listen(port?: number, hostname?: string, backlog?: number, callback?: Function): this; + /node.js:1434:17 + 1434| listen(port?: number, hostname?: string, backlog?: number, callback?: Function): this; ^^^^^^ [2] @@ -885,14 +885,14 @@ References: http/server.js:71:15 71| server.listen({}, () => {}, 123); ^^ [1] - /node.js:1435:17 - 1435| listen(port?: number, hostname?: string, backlog?: number, callback?: Function): this; + /node.js:1434:17 + 1434| listen(port?: number, hostname?: string, backlog?: number, callback?: Function): this; ^^^^^^ [2] - /node.js:1437:17 - 1437| listen(port?: number, backlog?: number, callback?: Function): this; + /node.js:1436:17 + 1436| listen(port?: number, backlog?: number, callback?: Function): this; ^^^^^^ [3] - /node.js:1438:17 - 1438| listen(port?: number, hostname?: string, callback?: Function): this; + /node.js:1437:17 + 1437| listen(port?: number, hostname?: string, callback?: Function): this; ^^^^^^ [4] @@ -911,14 +911,14 @@ References: http/server.js:72:15 72| server.listen({}, function() {}, 123); ^^ [1] - /node.js:1435:17 - 1435| listen(port?: number, hostname?: string, backlog?: number, callback?: Function): this; + /node.js:1434:17 + 1434| listen(port?: number, hostname?: string, backlog?: number, callback?: Function): this; ^^^^^^ [2] - /node.js:1437:17 - 1437| listen(port?: number, backlog?: number, callback?: Function): this; + /node.js:1436:17 + 1436| listen(port?: number, backlog?: number, callback?: Function): this; ^^^^^^ [3] - /node.js:1438:17 - 1438| listen(port?: number, hostname?: string, callback?: Function): this; + /node.js:1437:17 + 1437| listen(port?: number, hostname?: string, callback?: Function): this; ^^^^^^ [4] @@ -937,14 +937,14 @@ References: http/server.js:75:15 75| server.listen(() => {}, 'localhost', 123); ^^^^^^^^ [1] - /node.js:1435:17 - 1435| listen(port?: number, hostname?: string, backlog?: number, callback?: Function): this; + /node.js:1434:17 + 1434| listen(port?: number, hostname?: string, backlog?: number, callback?: Function): this; ^^^^^^ [2] - /node.js:1437:17 - 1437| listen(port?: number, backlog?: number, callback?: Function): this; + /node.js:1436:17 + 1436| listen(port?: number, backlog?: number, callback?: Function): this; ^^^^^^ [3] - /node.js:1438:17 - 1438| listen(port?: number, hostname?: string, callback?: Function): this; + /node.js:1437:17 + 1437| listen(port?: number, hostname?: string, callback?: Function): this; ^^^^^^ [4] @@ -963,14 +963,14 @@ References: http/server.js:76:15 76| server.listen(function() {}, 'localhost', 123); ^^^^^^^^^^ [1] - /node.js:1435:17 - 1435| listen(port?: number, hostname?: string, backlog?: number, callback?: Function): this; + /node.js:1434:17 + 1434| listen(port?: number, hostname?: string, backlog?: number, callback?: Function): this; ^^^^^^ [2] - /node.js:1437:17 - 1437| listen(port?: number, backlog?: number, callback?: Function): this; + /node.js:1436:17 + 1436| listen(port?: number, backlog?: number, callback?: Function): this; ^^^^^^ [3] - /node.js:1438:17 - 1438| listen(port?: number, hostname?: string, callback?: Function): this; + /node.js:1437:17 + 1437| listen(port?: number, hostname?: string, callback?: Function): this; ^^^^^^ [4] @@ -986,8 +986,8 @@ References: http/server.js:79:21 79| server.listen(8080, () => {}, 'localhost', 123); ^^^^^^^^ [1] - /node.js:1435:36 - 1435| listen(port?: number, hostname?: string, backlog?: number, callback?: Function): this; + /node.js:1434:36 + 1434| listen(port?: number, hostname?: string, backlog?: number, callback?: Function): this; ^^^^^^ [2] @@ -1003,8 +1003,8 @@ References: http/server.js:80:21 80| server.listen(8080, function() {}, 'localhost', 123); ^^^^^^^^^^ [1] - /node.js:1435:36 - 1435| listen(port?: number, hostname?: string, backlog?: number, callback?: Function): this; + /node.js:1434:36 + 1434| listen(port?: number, hostname?: string, backlog?: number, callback?: Function): this; ^^^^^^ [2] @@ -1023,14 +1023,14 @@ References: http/server.js:81:21 81| server.listen(8080, () => {}, 123); ^^^^^^^^ [1] - /node.js:1435:36 - 1435| listen(port?: number, hostname?: string, backlog?: number, callback?: Function): this; + /node.js:1434:36 + 1434| listen(port?: number, hostname?: string, backlog?: number, callback?: Function): this; ^^^^^^ [2] - /node.js:1437:35 - 1437| listen(port?: number, backlog?: number, callback?: Function): this; + /node.js:1436:35 + 1436| listen(port?: number, backlog?: number, callback?: Function): this; ^^^^^^ [3] - /node.js:1438:36 - 1438| listen(port?: number, hostname?: string, callback?: Function): this; + /node.js:1437:36 + 1437| listen(port?: number, hostname?: string, callback?: Function): this; ^^^^^^ [4] @@ -1049,14 +1049,14 @@ References: http/server.js:82:21 82| server.listen(8080, function() {}, 123); ^^^^^^^^^^ [1] - /node.js:1435:36 - 1435| listen(port?: number, hostname?: string, backlog?: number, callback?: Function): this; + /node.js:1434:36 + 1434| listen(port?: number, hostname?: string, backlog?: number, callback?: Function): this; ^^^^^^ [2] - /node.js:1437:35 - 1437| listen(port?: number, backlog?: number, callback?: Function): this; + /node.js:1436:35 + 1436| listen(port?: number, backlog?: number, callback?: Function): this; ^^^^^^ [3] - /node.js:1438:36 - 1438| listen(port?: number, hostname?: string, callback?: Function): this; + /node.js:1437:36 + 1437| listen(port?: number, hostname?: string, callback?: Function): this; ^^^^^^ [4] @@ -1075,14 +1075,14 @@ References: http/server.js:83:21 83| server.listen(8080, () => {}, 'localhost'); ^^^^^^^^ [1] - /node.js:1435:36 - 1435| listen(port?: number, hostname?: string, backlog?: number, callback?: Function): this; + /node.js:1434:36 + 1434| listen(port?: number, hostname?: string, backlog?: number, callback?: Function): this; ^^^^^^ [2] - /node.js:1437:35 - 1437| listen(port?: number, backlog?: number, callback?: Function): this; + /node.js:1436:35 + 1436| listen(port?: number, backlog?: number, callback?: Function): this; ^^^^^^ [3] - /node.js:1438:36 - 1438| listen(port?: number, hostname?: string, callback?: Function): this; + /node.js:1437:36 + 1437| listen(port?: number, hostname?: string, callback?: Function): this; ^^^^^^ [4] @@ -1101,14 +1101,14 @@ References: http/server.js:84:21 84| server.listen(8080, function() {}, 'localhost'); ^^^^^^^^^^ [1] - /node.js:1435:36 - 1435| listen(port?: number, hostname?: string, backlog?: number, callback?: Function): this; + /node.js:1434:36 + 1434| listen(port?: number, hostname?: string, backlog?: number, callback?: Function): this; ^^^^^^ [2] - /node.js:1437:35 - 1437| listen(port?: number, backlog?: number, callback?: Function): this; + /node.js:1436:35 + 1436| listen(port?: number, backlog?: number, callback?: Function): this; ^^^^^^ [3] - /node.js:1438:36 - 1438| listen(port?: number, hostname?: string, callback?: Function): this; + /node.js:1437:36 + 1437| listen(port?: number, hostname?: string, callback?: Function): this; ^^^^^^ [4] @@ -1124,8 +1124,8 @@ References: https/get.js:13:11 13| https.get(-1); // error ^^ [1] - /node.js:1583:10 - 1583| url: string, + /node.js:1582:10 + 1582| url: string, ^^^^^^ [2] @@ -1141,8 +1141,8 @@ References: https/get.js:14:18 14| https.get({port: 'expects number'}); // error ^^^^^^^^^^^^^^^^ [1] - /node.js:1496:10 - 1496| port?: number, + /node.js:1495:10 + 1495| port?: number, ^^^^^^ [2] @@ -1158,8 +1158,8 @@ References: https/get.js:15:20 15| https.get(url, {}, -1); // error ^^ [1] - /node.js:1585:16 - 1585| callback?: (response: IncomingMessage) => void + /node.js:1584:16 + 1584| callback?: (response: IncomingMessage) => void ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [2] @@ -1175,8 +1175,8 @@ References: https/get.js:16:23 16| https.get(url, {port: 'expects number'}, () => {}); // error ^^^^^^^^^^^^^^^^ [1] - /node.js:1496:10 - 1496| port?: number, + /node.js:1495:10 + 1495| port?: number, ^^^^^^ [2] @@ -1192,8 +1192,8 @@ References: https/request.js:13:15 13| https.request(-1); // error ^^ [1] - /node.js:1574:10 - 1574| url: string, + /node.js:1573:10 + 1573| url: string, ^^^^^^ [2] @@ -1209,8 +1209,8 @@ References: https/request.js:14:22 14| https.request({port: 'expects number'}); // error ^^^^^^^^^^^^^^^^ [1] - /node.js:1496:10 - 1496| port?: number, + /node.js:1495:10 + 1495| port?: number, ^^^^^^ [2] @@ -1226,8 +1226,8 @@ References: https/request.js:15:24 15| https.request(url, {}, -1); // error ^^ [1] - /node.js:1576:16 - 1576| callback?: (response: IncomingMessage) => void + /node.js:1575:16 + 1575| callback?: (response: IncomingMessage) => void ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [2] @@ -1243,8 +1243,8 @@ References: https/request.js:16:27 16| https.request(url, {port: 'expects number'}, () => {}); // error ^^^^^^^^^^^^^^^^ [1] - /node.js:1496:10 - 1496| port?: number, + /node.js:1495:10 + 1495| port?: number, ^^^^^^ [2] @@ -1260,8 +1260,8 @@ References: https/server.js:69:15 69| server.listen({}, () => {}, 'localhost', 123); ^^ [1] - /node.js:1462:17 - 1462| listen(port?: number, hostname?: string, backlog?: number, callback?: Function): this; + /node.js:1461:17 + 1461| listen(port?: number, hostname?: string, backlog?: number, callback?: Function): this; ^^^^^^ [2] @@ -1277,8 +1277,8 @@ References: https/server.js:70:15 70| server.listen({}, function() {}, 'localhost', 123); ^^ [1] - /node.js:1462:17 - 1462| listen(port?: number, hostname?: string, backlog?: number, callback?: Function): this; + /node.js:1461:17 + 1461| listen(port?: number, hostname?: string, backlog?: number, callback?: Function): this; ^^^^^^ [2] @@ -1297,14 +1297,14 @@ References: https/server.js:71:15 71| server.listen({}, () => {}, 123); ^^ [1] - /node.js:1462:17 - 1462| listen(port?: number, hostname?: string, backlog?: number, callback?: Function): this; + /node.js:1461:17 + 1461| listen(port?: number, hostname?: string, backlog?: number, callback?: Function): this; ^^^^^^ [2] - /node.js:1464:17 - 1464| listen(port?: number, backlog?: number, callback?: Function): this; + /node.js:1463:17 + 1463| listen(port?: number, backlog?: number, callback?: Function): this; ^^^^^^ [3] - /node.js:1465:17 - 1465| listen(port?: number, hostname?: string, callback?: Function): this; + /node.js:1464:17 + 1464| listen(port?: number, hostname?: string, callback?: Function): this; ^^^^^^ [4] @@ -1323,14 +1323,14 @@ References: https/server.js:72:15 72| server.listen({}, function() {}, 123); ^^ [1] - /node.js:1462:17 - 1462| listen(port?: number, hostname?: string, backlog?: number, callback?: Function): this; + /node.js:1461:17 + 1461| listen(port?: number, hostname?: string, backlog?: number, callback?: Function): this; ^^^^^^ [2] - /node.js:1464:17 - 1464| listen(port?: number, backlog?: number, callback?: Function): this; + /node.js:1463:17 + 1463| listen(port?: number, backlog?: number, callback?: Function): this; ^^^^^^ [3] - /node.js:1465:17 - 1465| listen(port?: number, hostname?: string, callback?: Function): this; + /node.js:1464:17 + 1464| listen(port?: number, hostname?: string, callback?: Function): this; ^^^^^^ [4] @@ -1349,14 +1349,14 @@ References: https/server.js:75:15 75| server.listen(() => {}, 'localhost', 123); ^^^^^^^^ [1] - /node.js:1462:17 - 1462| listen(port?: number, hostname?: string, backlog?: number, callback?: Function): this; + /node.js:1461:17 + 1461| listen(port?: number, hostname?: string, backlog?: number, callback?: Function): this; ^^^^^^ [2] - /node.js:1464:17 - 1464| listen(port?: number, backlog?: number, callback?: Function): this; + /node.js:1463:17 + 1463| listen(port?: number, backlog?: number, callback?: Function): this; ^^^^^^ [3] - /node.js:1465:17 - 1465| listen(port?: number, hostname?: string, callback?: Function): this; + /node.js:1464:17 + 1464| listen(port?: number, hostname?: string, callback?: Function): this; ^^^^^^ [4] @@ -1375,14 +1375,14 @@ References: https/server.js:76:15 76| server.listen(function() {}, 'localhost', 123); ^^^^^^^^^^ [1] - /node.js:1462:17 - 1462| listen(port?: number, hostname?: string, backlog?: number, callback?: Function): this; + /node.js:1461:17 + 1461| listen(port?: number, hostname?: string, backlog?: number, callback?: Function): this; ^^^^^^ [2] - /node.js:1464:17 - 1464| listen(port?: number, backlog?: number, callback?: Function): this; + /node.js:1463:17 + 1463| listen(port?: number, backlog?: number, callback?: Function): this; ^^^^^^ [3] - /node.js:1465:17 - 1465| listen(port?: number, hostname?: string, callback?: Function): this; + /node.js:1464:17 + 1464| listen(port?: number, hostname?: string, callback?: Function): this; ^^^^^^ [4] @@ -1398,8 +1398,8 @@ References: https/server.js:79:21 79| server.listen(8443, () => {}, 'localhost', 123); ^^^^^^^^ [1] - /node.js:1462:36 - 1462| listen(port?: number, hostname?: string, backlog?: number, callback?: Function): this; + /node.js:1461:36 + 1461| listen(port?: number, hostname?: string, backlog?: number, callback?: Function): this; ^^^^^^ [2] @@ -1415,8 +1415,8 @@ References: https/server.js:80:21 80| server.listen(8443, function() {}, 'localhost', 123); ^^^^^^^^^^ [1] - /node.js:1462:36 - 1462| listen(port?: number, hostname?: string, backlog?: number, callback?: Function): this; + /node.js:1461:36 + 1461| listen(port?: number, hostname?: string, backlog?: number, callback?: Function): this; ^^^^^^ [2] @@ -1435,14 +1435,14 @@ References: https/server.js:81:21 81| server.listen(8443, () => {}, 123); ^^^^^^^^ [1] - /node.js:1462:36 - 1462| listen(port?: number, hostname?: string, backlog?: number, callback?: Function): this; + /node.js:1461:36 + 1461| listen(port?: number, hostname?: string, backlog?: number, callback?: Function): this; ^^^^^^ [2] - /node.js:1464:35 - 1464| listen(port?: number, backlog?: number, callback?: Function): this; + /node.js:1463:35 + 1463| listen(port?: number, backlog?: number, callback?: Function): this; ^^^^^^ [3] - /node.js:1465:36 - 1465| listen(port?: number, hostname?: string, callback?: Function): this; + /node.js:1464:36 + 1464| listen(port?: number, hostname?: string, callback?: Function): this; ^^^^^^ [4] @@ -1461,14 +1461,14 @@ References: https/server.js:82:21 82| server.listen(8443, function() {}, 123); ^^^^^^^^^^ [1] - /node.js:1462:36 - 1462| listen(port?: number, hostname?: string, backlog?: number, callback?: Function): this; + /node.js:1461:36 + 1461| listen(port?: number, hostname?: string, backlog?: number, callback?: Function): this; ^^^^^^ [2] - /node.js:1464:35 - 1464| listen(port?: number, backlog?: number, callback?: Function): this; + /node.js:1463:35 + 1463| listen(port?: number, backlog?: number, callback?: Function): this; ^^^^^^ [3] - /node.js:1465:36 - 1465| listen(port?: number, hostname?: string, callback?: Function): this; + /node.js:1464:36 + 1464| listen(port?: number, hostname?: string, callback?: Function): this; ^^^^^^ [4] @@ -1487,14 +1487,14 @@ References: https/server.js:83:21 83| server.listen(8443, () => {}, 'localhost'); ^^^^^^^^ [1] - /node.js:1462:36 - 1462| listen(port?: number, hostname?: string, backlog?: number, callback?: Function): this; + /node.js:1461:36 + 1461| listen(port?: number, hostname?: string, backlog?: number, callback?: Function): this; ^^^^^^ [2] - /node.js:1464:35 - 1464| listen(port?: number, backlog?: number, callback?: Function): this; + /node.js:1463:35 + 1463| listen(port?: number, backlog?: number, callback?: Function): this; ^^^^^^ [3] - /node.js:1465:36 - 1465| listen(port?: number, hostname?: string, callback?: Function): this; + /node.js:1464:36 + 1464| listen(port?: number, hostname?: string, callback?: Function): this; ^^^^^^ [4] @@ -1513,14 +1513,14 @@ References: https/server.js:84:21 84| server.listen(8443, function() {}, 'localhost'); ^^^^^^^^^^ [1] - /node.js:1462:36 - 1462| listen(port?: number, hostname?: string, backlog?: number, callback?: Function): this; + /node.js:1461:36 + 1461| listen(port?: number, hostname?: string, backlog?: number, callback?: Function): this; ^^^^^^ [2] - /node.js:1464:35 - 1464| listen(port?: number, backlog?: number, callback?: Function): this; + /node.js:1463:35 + 1463| listen(port?: number, backlog?: number, callback?: Function): this; ^^^^^^ [3] - /node.js:1465:36 - 1465| listen(port?: number, hostname?: string, callback?: Function): this; + /node.js:1464:36 + 1464| listen(port?: number, hostname?: string, callback?: Function): this; ^^^^^^ [4] @@ -1532,6 +1532,115 @@ Unexpected end of input, expected a valid JSON value +Error -------------------------------------------------------------------------------------------- module/module.js:6:34 + +Cannot call `Module` with `1` bound to `id` because number [1] is incompatible with string [2]. [incompatible-call] + + module/module.js:6:34 + 6| const invalidModule = new Module(1); // error + ^ [1] + +References: + /node.js:1658:21 + 1658| constructor(id: string, parent?: typeof module): void; + ^^^^^^ [2] + + +Error ------------------------------------------------------------------------------------------- module/module.js:10:25 + +Cannot assign array literal to `myModule.globalPaths` because number [1] is incompatible with string [2] in array +element. [incompatible-type] + + module/module.js:10:25 + 10| myModule.globalPaths = [1]; // error + ^ [1] + +References: + /node.js:1659:18 + 1659| globalPaths: string[]; + ^^^^^^ [2] + + +Error -------------------------------------------------------------------------------------------- module/module.js:13:2 + +Cannot cast `myModule.load(...)` to `Module` because undefined [1] is incompatible with `Module` [2]. +[incompatible-cast] + + module/module.js:13:2 + 13| (myModule.load('a.js'): Module); // error + ^^^^^^^^^^^^^^^^^^^^^ + +References: + /node.js:1660:29 + 1660| load(fileName: string): void; + ^^^^ [1] + module/module.js:13:25 + 13| (myModule.load('a.js'): Module); // error + ^^^^^^ [2] + + +Error ------------------------------------------------------------------------------------------- module/module.js:17:21 + +Cannot assign object literal to `Module._cache` because number [1] is incompatible with `Module` [2] in property `a`. +[incompatible-type] + + module/module.js:17:21 + 17| Module._cache = {a: 123}; // error + ^^^ [1] + +References: + /node.js:1671:37 + 1671| static _cache: {|[key: string]: Module|}; + ^^^^^^ [2] + + +Error ------------------------------------------------------------------------------------------- module/module.js:20:23 + +Cannot call `Module._findPath` with `'/bcd'` bound to `paths` because string [1] is incompatible with array type [2]. +[incompatible-call] + + module/module.js:20:23 + 20| Module._findPath('a', '/bcd'); // error + ^^^^^^ [1] + +References: + /node.js:1679:15 + 1679| paths?: string[], + ^^^^^^^^ [2] + + +Error ------------------------------------------------------------------------------------------- module/module.js:33:35 + +Cannot call `Module._resolveFilename` with `'bar'` bound to `parent` because string [1] is incompatible with +`Module` [2]. [incompatible-call] + + module/module.js:33:35 + 33| Module._resolveFilename('foo.js', 'bar'); // error + ^^^^^ [1] + +References: + /node.js:1700:16 + 1700| parent?: Module, + ^^^^^^ [2] + + +Error -------------------------------------------------------------------------------------------- module/module.js:36:2 + +Cannot cast `filename` to boolean because string [1] is incompatible with boolean [2]. [incompatible-cast] + + module/module.js:36:2 + 36| (filename: boolean); // error + ^^^^^^^^ + +References: + /node.js:1703:10 + 1703| ) => string | false; + ^^^^^^ [1] + module/module.js:36:12 + 36| (filename: boolean); // error + ^^^^^^^ [2] + + Error ----------------------------------------------------------------------------------------------- os/userInfo.js:7:2 Cannot cast `u1.username` to `Buffer` because string [1] is incompatible with `Buffer` [2]. [incompatible-cast] @@ -1541,8 +1650,8 @@ Cannot cast `u1.username` to `Buffer` because string [1] is incompatible with `B ^^^^^^^^^^^ References: - /node.js:1726:13 - 1726| username: string, + /node.js:1778:13 + 1778| username: string, ^^^^^^ [1] os/userInfo.js:7:15 7| (u1.username: Buffer); // error @@ -1558,8 +1667,8 @@ Cannot cast `u2.username` to `Buffer` because string [1] is incompatible with `B ^^^^^^^^^^^ References: - /node.js:1726:13 - 1726| username: string, + /node.js:1778:13 + 1778| username: string, ^^^^^^ [1] os/userInfo.js:11:15 11| (u2.username: Buffer); // error @@ -1575,8 +1684,8 @@ Cannot cast `u3.username` to string because `Buffer` [1] is incompatible with st ^^^^^^^^^^^ References: - /node.js:1717:13 - 1717| username: Buffer, + /node.js:1769:13 + 1769| username: Buffer, ^^^^^^ [1] os/userInfo.js:14:15 14| (u3.username: string); // error @@ -1600,26 +1709,26 @@ References: process/emitWarning.js:10:1 10| process.emitWarning(); // error ^^^^^^^^^^^^^^^^^^^^^ [1] - /node.js:2632:24 - 2632| emitWarning(warning: string | Error): void; + /node.js:2685:24 + 2685| emitWarning(warning: string | Error): void; ^^^^^^ [2] - /node.js:2632:33 - 2632| emitWarning(warning: string | Error): void; + /node.js:2685:33 + 2685| emitWarning(warning: string | Error): void; ^^^^^ [3] - /node.js:2633:3 - 2633| emitWarning(warning: string, typeOrCtor: string | (...empty) => mixed): void; + /node.js:2686:3 + 2686| emitWarning(warning: string, typeOrCtor: string | (...empty) => mixed): void; ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [4] - /node.js:2634:3 - 2634| emitWarning(warning: string, type: string, codeOrCtor: string | (...empty) => mixed): void; + /node.js:2687:3 + 2687| emitWarning(warning: string, type: string, codeOrCtor: string | (...empty) => mixed): void; ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [5] - /node.js:2635:3 + /node.js:2688:3 v----------- - 2635| emitWarning( - 2636| warning: string, - 2637| type: string, - 2638| code: string, - 2639| ctor?: (...empty) => mixed - 2640| ): void; + 2688| emitWarning( + 2689| warning: string, + 2690| type: string, + 2691| code: string, + 2692| ctor?: (...empty) => mixed + 2693| ): void; ------^ [6] @@ -1638,14 +1747,14 @@ References: process/emitWarning.js:11:21 11| process.emitWarning(42); // error ^^ [1] - /node.js:2633:24 - 2633| emitWarning(warning: string, typeOrCtor: string | (...empty) => mixed): void; + /node.js:2686:24 + 2686| emitWarning(warning: string, typeOrCtor: string | (...empty) => mixed): void; ^^^^^^ [2] - /node.js:2634:24 - 2634| emitWarning(warning: string, type: string, codeOrCtor: string | (...empty) => mixed): void; + /node.js:2687:24 + 2687| emitWarning(warning: string, type: string, codeOrCtor: string | (...empty) => mixed): void; ^^^^^^ [3] - /node.js:2636:14 - 2636| warning: string, + /node.js:2689:14 + 2689| warning: string, ^^^^^^ [4] @@ -1663,11 +1772,11 @@ References: process/emitWarning.js:12:29 12| process.emitWarning("blah", 42); // error ^^ [1] - /node.js:2634:38 - 2634| emitWarning(warning: string, type: string, codeOrCtor: string | (...empty) => mixed): void; + /node.js:2687:38 + 2687| emitWarning(warning: string, type: string, codeOrCtor: string | (...empty) => mixed): void; ^^^^^^ [2] - /node.js:2637:11 - 2637| type: string, + /node.js:2690:11 + 2690| type: string, ^^^^^^ [3] @@ -1683,8 +1792,8 @@ References: process/emitWarning.js:13:37 13| process.emitWarning("blah", "blah", 42); // error ^^ [1] - /node.js:2638:11 - 2638| code: string, + /node.js:2691:11 + 2691| code: string, ^^^^^^ [2] @@ -1698,8 +1807,8 @@ Cannot cast `process.emitWarning(...)` to string because undefined [1] is incomp ^^^^^^^^^^^^^^^^^^^^^^^^^^^ References: - /node.js:2632:41 - 2632| emitWarning(warning: string | Error): void; + /node.js:2685:41 + 2685| emitWarning(warning: string | Error): void; ^^^^ [1] process/emitWarning.js:14:31 14| (process.emitWarning("blah"): string); // error @@ -1764,8 +1873,8 @@ References: process/nextTick.js:27:3 27| (a: string, b: number, c: boolean) => {} // Error: too few arguments ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [1] - /node.js:2661:21 - 2661| nextTick: (cb: (...T) => mixed, ...T) => void; + /node.js:2714:21 + 2714| nextTick: (cb: (...T) => mixed, ...T) => void; ^^^^^^^^^^^^^^^ [2] @@ -1779,8 +1888,8 @@ Cannot cast `process.allowedNodeEnvironmentFlags` to string because `Set` [1] is ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ References: - /node.js:2621:32 - 2621| allowedNodeEnvironmentFlags: Set; + /node.js:2674:32 + 2674| allowedNodeEnvironmentFlags: Set; ^^^^^^^^^^^ [1] process/process.js:5:39 5| (process.allowedNodeEnvironmentFlags: string); // error @@ -1813,8 +1922,8 @@ Cannot cast `error` to null because `Error` [1] is incompatible with null [2]. [ ^^^^^ References: - /node.js:2004:18 - 2004| cb: (error?: Error) => void, + /node.js:2056:18 + 2056| cb: (error?: Error) => void, ^^^^^ [1] stream/stream.js:45:13 45| (error: null); // error @@ -1830,8 +1939,8 @@ Cannot cast `error` to null because undefined [1] is incompatible with null [2]. ^^^^^ References: - /node.js:2004:18 - 2004| cb: (error?: Error) => void, + /node.js:2056:18 + 2056| cb: (error?: Error) => void, ^^^^^ [1] stream/stream.js:45:13 45| (error: null); // error @@ -1874,23 +1983,23 @@ References: stream/stream.js:53:3 53| new MyWriteStream(), // error - first stream must be Readable ^^^^^^^^^^^^^^^^^^^ [1] - /node.js:1989:9 - 1989| s1: stream$Readable, + /node.js:2041:9 + 2041| s1: stream$Readable, ^^^^^^^^^^^^^^^ [2] - /node.js:1994:9 - 1994| s1: stream$Readable, + /node.js:2046:9 + 2046| s1: stream$Readable, ^^^^^^^^^^^^^^^ [3] - /node.js:2000:9 - 2000| s1: stream$Readable, + /node.js:2052:9 + 2052| s1: stream$Readable, ^^^^^^^^^^^^^^^ [4] - /node.js:2007:9 - 2007| s1: stream$Readable, + /node.js:2059:9 + 2059| s1: stream$Readable, ^^^^^^^^^^^^^^^ [5] - /node.js:2015:9 - 2015| s1: stream$Readable, + /node.js:2067:9 + 2067| s1: stream$Readable, ^^^^^^^^^^^^^^^ [6] - /node.js:2024:9 - 2024| s1: stream$Readable, + /node.js:2076:9 + 2076| s1: stream$Readable, ^^^^^^^^^^^^^^^ [7] @@ -1911,20 +2020,20 @@ References: stream/stream.js:60:3 60| new MyWriteStream(), // error - middle stream must be Duplex ^^^^^^^^^^^^^^^^^^^ [1] - /node.js:1995:9 - 1995| s2: stream$Duplex, + /node.js:2047:9 + 2047| s2: stream$Duplex, ^^^^^^^^^^^^^ [2] - /node.js:2001:9 - 2001| s2: stream$Duplex, + /node.js:2053:9 + 2053| s2: stream$Duplex, ^^^^^^^^^^^^^ [3] - /node.js:2008:9 - 2008| s2: stream$Duplex, + /node.js:2060:9 + 2060| s2: stream$Duplex, ^^^^^^^^^^^^^ [4] - /node.js:2016:9 - 2016| s2: stream$Duplex, + /node.js:2068:9 + 2068| s2: stream$Duplex, ^^^^^^^^^^^^^ [5] - /node.js:2025:9 - 2025| s2: stream$Duplex, + /node.js:2077:9 + 2077| s2: stream$Duplex, ^^^^^^^^^^^^^ [6] @@ -1945,20 +2054,20 @@ References: stream/stream.js:68:3 68| new MyReadStream(), // error - last stream must be Writable ^^^^^^^^^^^^^^^^^^ [1] - /node.js:1993:32 - 1993| declare function pipeline( + /node.js:2045:32 + 2045| declare function pipeline( ^^^^^^^^^^^^^^^ [2] - /node.js:2002:9 - 2002| s3: stream$Duplex, + /node.js:2054:9 + 2054| s3: stream$Duplex, ^^^^^^^^^^^^^ [3] - /node.js:2009:9 - 2009| s3: stream$Duplex, + /node.js:2061:9 + 2061| s3: stream$Duplex, ^^^^^^^^^^^^^ [4] - /node.js:2017:9 - 2017| s3: stream$Duplex, + /node.js:2069:9 + 2069| s3: stream$Duplex, ^^^^^^^^^^^^^ [5] - /node.js:2026:9 - 2026| s3: stream$Duplex, + /node.js:2078:9 + 2078| s3: stream$Duplex, ^^^^^^^^^^^^^ [6] @@ -1971,8 +2080,8 @@ Cannot cast `url.parse(...).query` to empty because string [1] is incompatible w ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ References: - /node.js:2200:12 - 2200| query: string | null + /node.js:2252:12 + 2252| query: string | null ^^^^^^ [1] url/url.js:4:50 4| (url.parse('http://example.com/?foo=bar').query: empty); // error, string | null @@ -1988,8 +2097,8 @@ Cannot cast `url.parse(...).query` to empty because null [1] is incompatible wit ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ References: - /node.js:2200:21 - 2200| query: string | null + /node.js:2252:21 + 2252| query: string | null ^^^^ [1] url/url.js:4:50 4| (url.parse('http://example.com/?foo=bar').query: empty); // error, string | null @@ -2005,8 +2114,8 @@ Cannot cast `url.parse(...).query` to empty because object type [1] is incompati ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ References: - /node.js:2205:12 - 2205| query: { [string]: string, ... } + /node.js:2257:12 + 2257| query: { [string]: string, ... } ^^^^^^^^^^^^^^^^^^^^^^^^^ [1] url/url.js:5:56 5| (url.parse('http://example.com/?foo=bar', true).query: empty); // error, object @@ -2022,8 +2131,8 @@ Cannot cast `url.parse(...).query` to empty because string [1] is incompatible w ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ References: - /node.js:2192:12 - 2192| query: string | null | { [string]: string, ... }, + /node.js:2244:12 + 2244| query: string | null | { [string]: string, ... }, ^^^^^^ [1] url/url.js:8:70 8| (url.parse('http://example.com/?foo=bar', parseQueryString).query: empty); // error, string | null | object @@ -2039,8 +2148,8 @@ Cannot cast `url.parse(...).query` to empty because null [1] is incompatible wit ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ References: - /node.js:2192:21 - 2192| query: string | null | { [string]: string, ... }, + /node.js:2244:21 + 2244| query: string | null | { [string]: string, ... }, ^^^^ [1] url/url.js:8:70 8| (url.parse('http://example.com/?foo=bar', parseQueryString).query: empty); // error, string | null | object @@ -2056,8 +2165,8 @@ Cannot cast `url.parse(...).query` to empty because object type [1] is incompati ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ References: - /node.js:2192:28 - 2192| query: string | null | { [string]: string, ... }, + /node.js:2244:28 + 2244| query: string | null | { [string]: string, ... }, ^^^^^^^^^^^^^^^^^^^^^^^^^ [1] url/url.js:8:70 8| (url.parse('http://example.com/?foo=bar', parseQueryString).query: empty); // error, string | null | object @@ -2065,7 +2174,7 @@ References: -Found 108 errors +Found 115 errors Only showing the most relevant union/intersection branches. To see all branches, re-run Flow with --show-all-branches From f8b5595a4058edb32e519b5d2d5836294486b3aa Mon Sep 17 00:00:00 2001 From: Gora Kong Date: Fri, 11 Dec 2020 15:21:16 -0800 Subject: [PATCH 4/4] add missing exp files --- tests/enums/enums.exp | 60 ++-- tests/get_def_enums/get_def_enums.exp | 4 +- tests/node_tests/node_tests.exp | 468 +++++++++++++------------- 3 files changed, 266 insertions(+), 266 deletions(-) diff --git a/tests/enums/enums.exp b/tests/enums/enums.exp index 7a1b732d60a..5fdf4b6f1ea 100644 --- a/tests/enums/enums.exp +++ b/tests/enums/enums.exp @@ -1240,8 +1240,8 @@ References: exhaustive-check.js:3:6 3| enum E { ^ [2] - /core.js:2449:3 - 2449| isValid(input: ?TRepresentation): boolean, + /core.js:2451:3 + 2451| isValid(input: ?TRepresentation): boolean, ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [3] @@ -1850,14 +1850,14 @@ Cannot get `E.nonExistent` because property `nonExistent` is missing in `$EnumPr ^^^^^^^^^^^ References: - /core.js:2447:43 + /core.js:2449:43 v- - 2447| type $EnumProto = {| - 2448| cast(input: ?TRepresentation): void | TEnum, - 2449| isValid(input: ?TRepresentation): boolean, - 2450| members(): Iterable, - 2451| __proto__: null, - 2452| |} + 2449| type $EnumProto = {| + 2450| cast(input: ?TRepresentation): void | TEnum, + 2451| isValid(input: ?TRepresentation): boolean, + 2452| members(): Iterable, + 2453| __proto__: null, + 2454| |} -^ [1] @@ -1870,14 +1870,14 @@ Cannot call `E.nonExistent` because property `nonExistent` is missing in `$EnumP ^^^^^^^^^^^ References: - /core.js:2447:43 + /core.js:2449:43 v- - 2447| type $EnumProto = {| - 2448| cast(input: ?TRepresentation): void | TEnum, - 2449| isValid(input: ?TRepresentation): boolean, - 2450| members(): Iterable, - 2451| __proto__: null, - 2452| |} + 2449| type $EnumProto = {| + 2450| cast(input: ?TRepresentation): void | TEnum, + 2451| isValid(input: ?TRepresentation): boolean, + 2452| members(): Iterable, + 2453| __proto__: null, + 2454| |} -^ [1] @@ -1904,14 +1904,14 @@ Cannot call `E.A` because property `A` is missing in `$EnumProto` [1]. [prop-mis ^ References: - /core.js:2447:43 + /core.js:2449:43 v- - 2447| type $EnumProto = {| - 2448| cast(input: ?TRepresentation): void | TEnum, - 2449| isValid(input: ?TRepresentation): boolean, - 2450| members(): Iterable, - 2451| __proto__: null, - 2452| |} + 2449| type $EnumProto = {| + 2450| cast(input: ?TRepresentation): void | TEnum, + 2451| isValid(input: ?TRepresentation): boolean, + 2452| members(): Iterable, + 2453| __proto__: null, + 2454| |} -^ [1] @@ -1924,14 +1924,14 @@ Cannot call `E.toString` because property `toString` is missing in `$EnumProto` ^^^^^^^^ References: - /core.js:2447:43 + /core.js:2449:43 v- - 2447| type $EnumProto = {| - 2448| cast(input: ?TRepresentation): void | TEnum, - 2449| isValid(input: ?TRepresentation): boolean, - 2450| members(): Iterable, - 2451| __proto__: null, - 2452| |} + 2449| type $EnumProto = {| + 2450| cast(input: ?TRepresentation): void | TEnum, + 2451| isValid(input: ?TRepresentation): boolean, + 2452| members(): Iterable, + 2453| __proto__: null, + 2454| |} -^ [1] diff --git a/tests/get_def_enums/get_def_enums.exp b/tests/get_def_enums/get_def_enums.exp index 8fac4defde7..414c05c77e4 100644 --- a/tests/get_def_enums/get_def_enums.exp +++ b/tests/get_def_enums/get_def_enums.exp @@ -24,9 +24,9 @@ library.js:4:3,4:5 main.js:23:13 Flags: -[LIB] core.js:2448:3,2448:6 +[LIB] core.js:2450:3,2450:6 main.js:26:13 Flags: -[LIB] core.js:2449:3,2449:9 +[LIB] core.js:2451:3,2451:9 diff --git a/tests/node_tests/node_tests.exp b/tests/node_tests/node_tests.exp index 52862515fae..7c3cbd43c6f 100644 --- a/tests/node_tests/node_tests.exp +++ b/tests/node_tests/node_tests.exp @@ -47,8 +47,8 @@ Cannot cast `hmac.read()` to number because null or undefined [1] is incompatibl ^^^^^^^^^^^ References: - /node.js:1928:24 - 1928| read(size?: number): ?(string | Buffer); + /node.js:1929:24 + 1929| read(size?: number): ?(string | Buffer); ^^^^^^^^^^^^^^^^^^ [1] crypto/crypto.js:12:21 12| (hmac.read(): number); // 4 errors: null, void, string, Buffer @@ -64,8 +64,8 @@ Cannot cast `hmac.read()` to number because string [1] is incompatible with numb ^^^^^^^^^^^ References: - /node.js:1928:26 - 1928| read(size?: number): ?(string | Buffer); + /node.js:1929:26 + 1929| read(size?: number): ?(string | Buffer); ^^^^^^ [1] crypto/crypto.js:12:21 12| (hmac.read(): number); // 4 errors: null, void, string, Buffer @@ -81,8 +81,8 @@ Cannot cast `hmac.read()` to number because `Buffer` [1] is incompatible with nu ^^^^^^^^^^^ References: - /node.js:1928:35 - 1928| read(size?: number): ?(string | Buffer); + /node.js:1929:35 + 1929| read(size?: number): ?(string | Buffer); ^^^^^^ [1] crypto/crypto.js:12:21 12| (hmac.read(): number); // 4 errors: null, void, string, Buffer @@ -103,11 +103,11 @@ References: crypto/crypto.js:16:16 16| hmac.write(123); // 2 errors: not a string or a Buffer ^^^ [1] - /node.js:1972:16 - 1972| write(chunk: string | Buffer | Uint8Array, callback?: (error?: Error) => void): boolean; - ^^^^^^ [2] /node.js:1973:16 - 1973| write(chunk: string | Buffer | Uint8Array, encoding?: string, callback?: (error?: Error) => void): boolean; + 1973| write(chunk: string | Buffer | Uint8Array, callback?: (error?: Error) => void): boolean; + ^^^^^^ [2] + /node.js:1974:16 + 1974| write(chunk: string | Buffer | Uint8Array, encoding?: string, callback?: (error?: Error) => void): boolean; ^^^^^^ [3] @@ -618,11 +618,11 @@ fix add a type annotation to `_` [3] or to `data` [4]. [speculation-ambiguous] -^ References: - /node.js:1103:20 - 1103| declare function readFile( + /node.js:1104:20 + 1104| declare function readFile( ^^^^^^^^ [1] - /node.js:1112:20 - 1112| declare function readFile( + /node.js:1113:20 + 1113| declare function readFile( ^^^^^^^^ [2] fs/fs.js:13:48 13| fs.readFile("file.exp", { encoding: "blah" }, (_, data) => { @@ -641,8 +641,8 @@ Cannot cast `fs.readFileSync(...)` to string because `Buffer` [1] is incompatibl ^^^^^^^^^^^^^^^^^^^^^^^^^^^ References: - /node.js:1119:6 - 1119| ): Buffer; + /node.js:1120:6 + 1120| ): Buffer; ^^^^^^ [1] fs/fs.js:28:32 28| (fs.readFileSync("file.exp") : string); // error @@ -658,8 +658,8 @@ Cannot cast `fs.readFileSync(...)` to `Buffer` because string [1] is incompatibl ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ References: - /node.js:1123:6 - 1123| ): string; + /node.js:1124:6 + 1124| ): string; ^^^^^^ [1] fs/fs.js:31:40 31| (fs.readFileSync("file.exp", "blah") : Buffer); // error @@ -675,8 +675,8 @@ Cannot cast `fs.readFileSync(...)` to `Buffer` because string [1] is incompatibl ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ References: - /node.js:1128:7 - 1128| }): string; + /node.js:1129:7 + 1129| }): string; ^^^^^^ [1] fs/fs.js:34:54 34| (fs.readFileSync("file.exp", { encoding: "blah" }) : Buffer); // error @@ -692,8 +692,8 @@ Cannot cast `fs.readFileSync(...)` to string because `Buffer` [1] is incompatibl ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ References: - /node.js:1133:7 - 1133| }): Buffer; + /node.js:1134:7 + 1134| }): Buffer; ^^^^^^ [1] fs/fs.js:37:36 37| (fs.readFileSync("file.exp", {}) : string); // error @@ -712,8 +712,8 @@ References: http/get.js:13:10 13| http.get(-1); // error ^^ [1] - /node.js:1535:10 - 1535| url: string, + /node.js:1536:10 + 1536| url: string, ^^^^^^ [2] @@ -729,8 +729,8 @@ References: http/get.js:14:17 14| http.get({port: 'expects number'}); // error ^^^^^^^^^^^^^^^^ [1] - /node.js:1495:10 - 1495| port?: number, + /node.js:1496:10 + 1496| port?: number, ^^^^^^ [2] @@ -746,8 +746,8 @@ References: http/get.js:15:19 15| http.get(url, {}, -1); // error ^^ [1] - /node.js:1537:16 - 1537| callback?: (response: IncomingMessage) => void + /node.js:1538:16 + 1538| callback?: (response: IncomingMessage) => void ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [2] @@ -763,8 +763,8 @@ References: http/get.js:16:22 16| http.get(url, {port: 'expects number'}, () => {}); // error ^^^^^^^^^^^^^^^^ [1] - /node.js:1495:10 - 1495| port?: number, + /node.js:1496:10 + 1496| port?: number, ^^^^^^ [2] @@ -780,8 +780,8 @@ References: http/request.js:13:14 13| http.request(-1); // error ^^ [1] - /node.js:1526:10 - 1526| url: string, + /node.js:1527:10 + 1527| url: string, ^^^^^^ [2] @@ -797,8 +797,8 @@ References: http/request.js:14:21 14| http.request({port: 'expects number'}); // error ^^^^^^^^^^^^^^^^ [1] - /node.js:1495:10 - 1495| port?: number, + /node.js:1496:10 + 1496| port?: number, ^^^^^^ [2] @@ -814,8 +814,8 @@ References: http/request.js:15:23 15| http.request(url, {}, -1); // error ^^ [1] - /node.js:1528:16 - 1528| callback?: (response: IncomingMessage) => void + /node.js:1529:16 + 1529| callback?: (response: IncomingMessage) => void ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [2] @@ -831,8 +831,8 @@ References: http/request.js:16:26 16| http.request(url, {port: 'expects number'}, () => {}); // error ^^^^^^^^^^^^^^^^ [1] - /node.js:1495:10 - 1495| port?: number, + /node.js:1496:10 + 1496| port?: number, ^^^^^^ [2] @@ -848,8 +848,8 @@ References: http/server.js:69:15 69| server.listen({}, () => {}, 'localhost', 123); ^^ [1] - /node.js:1434:17 - 1434| listen(port?: number, hostname?: string, backlog?: number, callback?: Function): this; + /node.js:1435:17 + 1435| listen(port?: number, hostname?: string, backlog?: number, callback?: Function): this; ^^^^^^ [2] @@ -865,8 +865,8 @@ References: http/server.js:70:15 70| server.listen({}, function() {}, 'localhost', 123); ^^ [1] - /node.js:1434:17 - 1434| listen(port?: number, hostname?: string, backlog?: number, callback?: Function): this; + /node.js:1435:17 + 1435| listen(port?: number, hostname?: string, backlog?: number, callback?: Function): this; ^^^^^^ [2] @@ -885,14 +885,14 @@ References: http/server.js:71:15 71| server.listen({}, () => {}, 123); ^^ [1] - /node.js:1434:17 - 1434| listen(port?: number, hostname?: string, backlog?: number, callback?: Function): this; + /node.js:1435:17 + 1435| listen(port?: number, hostname?: string, backlog?: number, callback?: Function): this; ^^^^^^ [2] - /node.js:1436:17 - 1436| listen(port?: number, backlog?: number, callback?: Function): this; - ^^^^^^ [3] /node.js:1437:17 - 1437| listen(port?: number, hostname?: string, callback?: Function): this; + 1437| listen(port?: number, backlog?: number, callback?: Function): this; + ^^^^^^ [3] + /node.js:1438:17 + 1438| listen(port?: number, hostname?: string, callback?: Function): this; ^^^^^^ [4] @@ -911,14 +911,14 @@ References: http/server.js:72:15 72| server.listen({}, function() {}, 123); ^^ [1] - /node.js:1434:17 - 1434| listen(port?: number, hostname?: string, backlog?: number, callback?: Function): this; + /node.js:1435:17 + 1435| listen(port?: number, hostname?: string, backlog?: number, callback?: Function): this; ^^^^^^ [2] - /node.js:1436:17 - 1436| listen(port?: number, backlog?: number, callback?: Function): this; - ^^^^^^ [3] /node.js:1437:17 - 1437| listen(port?: number, hostname?: string, callback?: Function): this; + 1437| listen(port?: number, backlog?: number, callback?: Function): this; + ^^^^^^ [3] + /node.js:1438:17 + 1438| listen(port?: number, hostname?: string, callback?: Function): this; ^^^^^^ [4] @@ -937,14 +937,14 @@ References: http/server.js:75:15 75| server.listen(() => {}, 'localhost', 123); ^^^^^^^^ [1] - /node.js:1434:17 - 1434| listen(port?: number, hostname?: string, backlog?: number, callback?: Function): this; + /node.js:1435:17 + 1435| listen(port?: number, hostname?: string, backlog?: number, callback?: Function): this; ^^^^^^ [2] - /node.js:1436:17 - 1436| listen(port?: number, backlog?: number, callback?: Function): this; - ^^^^^^ [3] /node.js:1437:17 - 1437| listen(port?: number, hostname?: string, callback?: Function): this; + 1437| listen(port?: number, backlog?: number, callback?: Function): this; + ^^^^^^ [3] + /node.js:1438:17 + 1438| listen(port?: number, hostname?: string, callback?: Function): this; ^^^^^^ [4] @@ -963,14 +963,14 @@ References: http/server.js:76:15 76| server.listen(function() {}, 'localhost', 123); ^^^^^^^^^^ [1] - /node.js:1434:17 - 1434| listen(port?: number, hostname?: string, backlog?: number, callback?: Function): this; + /node.js:1435:17 + 1435| listen(port?: number, hostname?: string, backlog?: number, callback?: Function): this; ^^^^^^ [2] - /node.js:1436:17 - 1436| listen(port?: number, backlog?: number, callback?: Function): this; - ^^^^^^ [3] /node.js:1437:17 - 1437| listen(port?: number, hostname?: string, callback?: Function): this; + 1437| listen(port?: number, backlog?: number, callback?: Function): this; + ^^^^^^ [3] + /node.js:1438:17 + 1438| listen(port?: number, hostname?: string, callback?: Function): this; ^^^^^^ [4] @@ -986,8 +986,8 @@ References: http/server.js:79:21 79| server.listen(8080, () => {}, 'localhost', 123); ^^^^^^^^ [1] - /node.js:1434:36 - 1434| listen(port?: number, hostname?: string, backlog?: number, callback?: Function): this; + /node.js:1435:36 + 1435| listen(port?: number, hostname?: string, backlog?: number, callback?: Function): this; ^^^^^^ [2] @@ -1003,8 +1003,8 @@ References: http/server.js:80:21 80| server.listen(8080, function() {}, 'localhost', 123); ^^^^^^^^^^ [1] - /node.js:1434:36 - 1434| listen(port?: number, hostname?: string, backlog?: number, callback?: Function): this; + /node.js:1435:36 + 1435| listen(port?: number, hostname?: string, backlog?: number, callback?: Function): this; ^^^^^^ [2] @@ -1023,14 +1023,14 @@ References: http/server.js:81:21 81| server.listen(8080, () => {}, 123); ^^^^^^^^ [1] - /node.js:1434:36 - 1434| listen(port?: number, hostname?: string, backlog?: number, callback?: Function): this; + /node.js:1435:36 + 1435| listen(port?: number, hostname?: string, backlog?: number, callback?: Function): this; ^^^^^^ [2] - /node.js:1436:35 - 1436| listen(port?: number, backlog?: number, callback?: Function): this; + /node.js:1437:35 + 1437| listen(port?: number, backlog?: number, callback?: Function): this; ^^^^^^ [3] - /node.js:1437:36 - 1437| listen(port?: number, hostname?: string, callback?: Function): this; + /node.js:1438:36 + 1438| listen(port?: number, hostname?: string, callback?: Function): this; ^^^^^^ [4] @@ -1049,14 +1049,14 @@ References: http/server.js:82:21 82| server.listen(8080, function() {}, 123); ^^^^^^^^^^ [1] - /node.js:1434:36 - 1434| listen(port?: number, hostname?: string, backlog?: number, callback?: Function): this; + /node.js:1435:36 + 1435| listen(port?: number, hostname?: string, backlog?: number, callback?: Function): this; ^^^^^^ [2] - /node.js:1436:35 - 1436| listen(port?: number, backlog?: number, callback?: Function): this; + /node.js:1437:35 + 1437| listen(port?: number, backlog?: number, callback?: Function): this; ^^^^^^ [3] - /node.js:1437:36 - 1437| listen(port?: number, hostname?: string, callback?: Function): this; + /node.js:1438:36 + 1438| listen(port?: number, hostname?: string, callback?: Function): this; ^^^^^^ [4] @@ -1075,14 +1075,14 @@ References: http/server.js:83:21 83| server.listen(8080, () => {}, 'localhost'); ^^^^^^^^ [1] - /node.js:1434:36 - 1434| listen(port?: number, hostname?: string, backlog?: number, callback?: Function): this; + /node.js:1435:36 + 1435| listen(port?: number, hostname?: string, backlog?: number, callback?: Function): this; ^^^^^^ [2] - /node.js:1436:35 - 1436| listen(port?: number, backlog?: number, callback?: Function): this; + /node.js:1437:35 + 1437| listen(port?: number, backlog?: number, callback?: Function): this; ^^^^^^ [3] - /node.js:1437:36 - 1437| listen(port?: number, hostname?: string, callback?: Function): this; + /node.js:1438:36 + 1438| listen(port?: number, hostname?: string, callback?: Function): this; ^^^^^^ [4] @@ -1101,14 +1101,14 @@ References: http/server.js:84:21 84| server.listen(8080, function() {}, 'localhost'); ^^^^^^^^^^ [1] - /node.js:1434:36 - 1434| listen(port?: number, hostname?: string, backlog?: number, callback?: Function): this; + /node.js:1435:36 + 1435| listen(port?: number, hostname?: string, backlog?: number, callback?: Function): this; ^^^^^^ [2] - /node.js:1436:35 - 1436| listen(port?: number, backlog?: number, callback?: Function): this; + /node.js:1437:35 + 1437| listen(port?: number, backlog?: number, callback?: Function): this; ^^^^^^ [3] - /node.js:1437:36 - 1437| listen(port?: number, hostname?: string, callback?: Function): this; + /node.js:1438:36 + 1438| listen(port?: number, hostname?: string, callback?: Function): this; ^^^^^^ [4] @@ -1124,8 +1124,8 @@ References: https/get.js:13:11 13| https.get(-1); // error ^^ [1] - /node.js:1582:10 - 1582| url: string, + /node.js:1583:10 + 1583| url: string, ^^^^^^ [2] @@ -1141,8 +1141,8 @@ References: https/get.js:14:18 14| https.get({port: 'expects number'}); // error ^^^^^^^^^^^^^^^^ [1] - /node.js:1495:10 - 1495| port?: number, + /node.js:1496:10 + 1496| port?: number, ^^^^^^ [2] @@ -1158,8 +1158,8 @@ References: https/get.js:15:20 15| https.get(url, {}, -1); // error ^^ [1] - /node.js:1584:16 - 1584| callback?: (response: IncomingMessage) => void + /node.js:1585:16 + 1585| callback?: (response: IncomingMessage) => void ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [2] @@ -1175,8 +1175,8 @@ References: https/get.js:16:23 16| https.get(url, {port: 'expects number'}, () => {}); // error ^^^^^^^^^^^^^^^^ [1] - /node.js:1495:10 - 1495| port?: number, + /node.js:1496:10 + 1496| port?: number, ^^^^^^ [2] @@ -1192,8 +1192,8 @@ References: https/request.js:13:15 13| https.request(-1); // error ^^ [1] - /node.js:1573:10 - 1573| url: string, + /node.js:1574:10 + 1574| url: string, ^^^^^^ [2] @@ -1209,8 +1209,8 @@ References: https/request.js:14:22 14| https.request({port: 'expects number'}); // error ^^^^^^^^^^^^^^^^ [1] - /node.js:1495:10 - 1495| port?: number, + /node.js:1496:10 + 1496| port?: number, ^^^^^^ [2] @@ -1226,8 +1226,8 @@ References: https/request.js:15:24 15| https.request(url, {}, -1); // error ^^ [1] - /node.js:1575:16 - 1575| callback?: (response: IncomingMessage) => void + /node.js:1576:16 + 1576| callback?: (response: IncomingMessage) => void ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [2] @@ -1243,8 +1243,8 @@ References: https/request.js:16:27 16| https.request(url, {port: 'expects number'}, () => {}); // error ^^^^^^^^^^^^^^^^ [1] - /node.js:1495:10 - 1495| port?: number, + /node.js:1496:10 + 1496| port?: number, ^^^^^^ [2] @@ -1260,8 +1260,8 @@ References: https/server.js:69:15 69| server.listen({}, () => {}, 'localhost', 123); ^^ [1] - /node.js:1461:17 - 1461| listen(port?: number, hostname?: string, backlog?: number, callback?: Function): this; + /node.js:1462:17 + 1462| listen(port?: number, hostname?: string, backlog?: number, callback?: Function): this; ^^^^^^ [2] @@ -1277,8 +1277,8 @@ References: https/server.js:70:15 70| server.listen({}, function() {}, 'localhost', 123); ^^ [1] - /node.js:1461:17 - 1461| listen(port?: number, hostname?: string, backlog?: number, callback?: Function): this; + /node.js:1462:17 + 1462| listen(port?: number, hostname?: string, backlog?: number, callback?: Function): this; ^^^^^^ [2] @@ -1297,14 +1297,14 @@ References: https/server.js:71:15 71| server.listen({}, () => {}, 123); ^^ [1] - /node.js:1461:17 - 1461| listen(port?: number, hostname?: string, backlog?: number, callback?: Function): this; + /node.js:1462:17 + 1462| listen(port?: number, hostname?: string, backlog?: number, callback?: Function): this; ^^^^^^ [2] - /node.js:1463:17 - 1463| listen(port?: number, backlog?: number, callback?: Function): this; - ^^^^^^ [3] /node.js:1464:17 - 1464| listen(port?: number, hostname?: string, callback?: Function): this; + 1464| listen(port?: number, backlog?: number, callback?: Function): this; + ^^^^^^ [3] + /node.js:1465:17 + 1465| listen(port?: number, hostname?: string, callback?: Function): this; ^^^^^^ [4] @@ -1323,14 +1323,14 @@ References: https/server.js:72:15 72| server.listen({}, function() {}, 123); ^^ [1] - /node.js:1461:17 - 1461| listen(port?: number, hostname?: string, backlog?: number, callback?: Function): this; + /node.js:1462:17 + 1462| listen(port?: number, hostname?: string, backlog?: number, callback?: Function): this; ^^^^^^ [2] - /node.js:1463:17 - 1463| listen(port?: number, backlog?: number, callback?: Function): this; - ^^^^^^ [3] /node.js:1464:17 - 1464| listen(port?: number, hostname?: string, callback?: Function): this; + 1464| listen(port?: number, backlog?: number, callback?: Function): this; + ^^^^^^ [3] + /node.js:1465:17 + 1465| listen(port?: number, hostname?: string, callback?: Function): this; ^^^^^^ [4] @@ -1349,14 +1349,14 @@ References: https/server.js:75:15 75| server.listen(() => {}, 'localhost', 123); ^^^^^^^^ [1] - /node.js:1461:17 - 1461| listen(port?: number, hostname?: string, backlog?: number, callback?: Function): this; + /node.js:1462:17 + 1462| listen(port?: number, hostname?: string, backlog?: number, callback?: Function): this; ^^^^^^ [2] - /node.js:1463:17 - 1463| listen(port?: number, backlog?: number, callback?: Function): this; - ^^^^^^ [3] /node.js:1464:17 - 1464| listen(port?: number, hostname?: string, callback?: Function): this; + 1464| listen(port?: number, backlog?: number, callback?: Function): this; + ^^^^^^ [3] + /node.js:1465:17 + 1465| listen(port?: number, hostname?: string, callback?: Function): this; ^^^^^^ [4] @@ -1375,14 +1375,14 @@ References: https/server.js:76:15 76| server.listen(function() {}, 'localhost', 123); ^^^^^^^^^^ [1] - /node.js:1461:17 - 1461| listen(port?: number, hostname?: string, backlog?: number, callback?: Function): this; + /node.js:1462:17 + 1462| listen(port?: number, hostname?: string, backlog?: number, callback?: Function): this; ^^^^^^ [2] - /node.js:1463:17 - 1463| listen(port?: number, backlog?: number, callback?: Function): this; - ^^^^^^ [3] /node.js:1464:17 - 1464| listen(port?: number, hostname?: string, callback?: Function): this; + 1464| listen(port?: number, backlog?: number, callback?: Function): this; + ^^^^^^ [3] + /node.js:1465:17 + 1465| listen(port?: number, hostname?: string, callback?: Function): this; ^^^^^^ [4] @@ -1398,8 +1398,8 @@ References: https/server.js:79:21 79| server.listen(8443, () => {}, 'localhost', 123); ^^^^^^^^ [1] - /node.js:1461:36 - 1461| listen(port?: number, hostname?: string, backlog?: number, callback?: Function): this; + /node.js:1462:36 + 1462| listen(port?: number, hostname?: string, backlog?: number, callback?: Function): this; ^^^^^^ [2] @@ -1415,8 +1415,8 @@ References: https/server.js:80:21 80| server.listen(8443, function() {}, 'localhost', 123); ^^^^^^^^^^ [1] - /node.js:1461:36 - 1461| listen(port?: number, hostname?: string, backlog?: number, callback?: Function): this; + /node.js:1462:36 + 1462| listen(port?: number, hostname?: string, backlog?: number, callback?: Function): this; ^^^^^^ [2] @@ -1435,14 +1435,14 @@ References: https/server.js:81:21 81| server.listen(8443, () => {}, 123); ^^^^^^^^ [1] - /node.js:1461:36 - 1461| listen(port?: number, hostname?: string, backlog?: number, callback?: Function): this; + /node.js:1462:36 + 1462| listen(port?: number, hostname?: string, backlog?: number, callback?: Function): this; ^^^^^^ [2] - /node.js:1463:35 - 1463| listen(port?: number, backlog?: number, callback?: Function): this; + /node.js:1464:35 + 1464| listen(port?: number, backlog?: number, callback?: Function): this; ^^^^^^ [3] - /node.js:1464:36 - 1464| listen(port?: number, hostname?: string, callback?: Function): this; + /node.js:1465:36 + 1465| listen(port?: number, hostname?: string, callback?: Function): this; ^^^^^^ [4] @@ -1461,14 +1461,14 @@ References: https/server.js:82:21 82| server.listen(8443, function() {}, 123); ^^^^^^^^^^ [1] - /node.js:1461:36 - 1461| listen(port?: number, hostname?: string, backlog?: number, callback?: Function): this; + /node.js:1462:36 + 1462| listen(port?: number, hostname?: string, backlog?: number, callback?: Function): this; ^^^^^^ [2] - /node.js:1463:35 - 1463| listen(port?: number, backlog?: number, callback?: Function): this; + /node.js:1464:35 + 1464| listen(port?: number, backlog?: number, callback?: Function): this; ^^^^^^ [3] - /node.js:1464:36 - 1464| listen(port?: number, hostname?: string, callback?: Function): this; + /node.js:1465:36 + 1465| listen(port?: number, hostname?: string, callback?: Function): this; ^^^^^^ [4] @@ -1487,14 +1487,14 @@ References: https/server.js:83:21 83| server.listen(8443, () => {}, 'localhost'); ^^^^^^^^ [1] - /node.js:1461:36 - 1461| listen(port?: number, hostname?: string, backlog?: number, callback?: Function): this; + /node.js:1462:36 + 1462| listen(port?: number, hostname?: string, backlog?: number, callback?: Function): this; ^^^^^^ [2] - /node.js:1463:35 - 1463| listen(port?: number, backlog?: number, callback?: Function): this; + /node.js:1464:35 + 1464| listen(port?: number, backlog?: number, callback?: Function): this; ^^^^^^ [3] - /node.js:1464:36 - 1464| listen(port?: number, hostname?: string, callback?: Function): this; + /node.js:1465:36 + 1465| listen(port?: number, hostname?: string, callback?: Function): this; ^^^^^^ [4] @@ -1513,14 +1513,14 @@ References: https/server.js:84:21 84| server.listen(8443, function() {}, 'localhost'); ^^^^^^^^^^ [1] - /node.js:1461:36 - 1461| listen(port?: number, hostname?: string, backlog?: number, callback?: Function): this; + /node.js:1462:36 + 1462| listen(port?: number, hostname?: string, backlog?: number, callback?: Function): this; ^^^^^^ [2] - /node.js:1463:35 - 1463| listen(port?: number, backlog?: number, callback?: Function): this; + /node.js:1464:35 + 1464| listen(port?: number, backlog?: number, callback?: Function): this; ^^^^^^ [3] - /node.js:1464:36 - 1464| listen(port?: number, hostname?: string, callback?: Function): this; + /node.js:1465:36 + 1465| listen(port?: number, hostname?: string, callback?: Function): this; ^^^^^^ [4] @@ -1541,8 +1541,8 @@ Cannot call `Module` with `1` bound to `id` because number [1] is incompatible w ^ [1] References: - /node.js:1658:21 - 1658| constructor(id: string, parent?: typeof module): void; + /node.js:1659:21 + 1659| constructor(id: string, parent?: typeof module): void; ^^^^^^ [2] @@ -1556,8 +1556,8 @@ element. [incompatible-type] ^ [1] References: - /node.js:1659:18 - 1659| globalPaths: string[]; + /node.js:1660:18 + 1660| globalPaths: string[]; ^^^^^^ [2] @@ -1571,8 +1571,8 @@ Cannot cast `myModule.load(...)` to `Module` because undefined [1] is incompatib ^^^^^^^^^^^^^^^^^^^^^ References: - /node.js:1660:29 - 1660| load(fileName: string): void; + /node.js:1661:29 + 1661| load(fileName: string): void; ^^^^ [1] module/module.js:13:25 13| (myModule.load('a.js'): Module); // error @@ -1589,8 +1589,8 @@ Cannot assign object literal to `Module._cache` because number [1] is incompatib ^^^ [1] References: - /node.js:1671:37 - 1671| static _cache: {|[key: string]: Module|}; + /node.js:1672:37 + 1672| static _cache: {|[key: string]: Module|}; ^^^^^^ [2] @@ -1604,8 +1604,8 @@ Cannot call `Module._findPath` with `'/bcd'` bound to `paths` because string [1] ^^^^^^ [1] References: - /node.js:1679:15 - 1679| paths?: string[], + /node.js:1680:15 + 1680| paths?: string[], ^^^^^^^^ [2] @@ -1619,8 +1619,8 @@ Cannot call `Module._resolveFilename` with `'bar'` bound to `parent` because str ^^^^^ [1] References: - /node.js:1700:16 - 1700| parent?: Module, + /node.js:1701:16 + 1701| parent?: Module, ^^^^^^ [2] @@ -1633,8 +1633,8 @@ Cannot cast `filename` to boolean because string [1] is incompatible with boolea ^^^^^^^^ References: - /node.js:1703:10 - 1703| ) => string | false; + /node.js:1704:10 + 1704| ) => string | false; ^^^^^^ [1] module/module.js:36:12 36| (filename: boolean); // error @@ -1650,8 +1650,8 @@ Cannot cast `u1.username` to `Buffer` because string [1] is incompatible with `B ^^^^^^^^^^^ References: - /node.js:1778:13 - 1778| username: string, + /node.js:1779:13 + 1779| username: string, ^^^^^^ [1] os/userInfo.js:7:15 7| (u1.username: Buffer); // error @@ -1667,8 +1667,8 @@ Cannot cast `u2.username` to `Buffer` because string [1] is incompatible with `B ^^^^^^^^^^^ References: - /node.js:1778:13 - 1778| username: string, + /node.js:1779:13 + 1779| username: string, ^^^^^^ [1] os/userInfo.js:11:15 11| (u2.username: Buffer); // error @@ -1684,8 +1684,8 @@ Cannot cast `u3.username` to string because `Buffer` [1] is incompatible with st ^^^^^^^^^^^ References: - /node.js:1769:13 - 1769| username: Buffer, + /node.js:1770:13 + 1770| username: Buffer, ^^^^^^ [1] os/userInfo.js:14:15 14| (u3.username: string); // error @@ -1922,8 +1922,8 @@ Cannot cast `error` to null because `Error` [1] is incompatible with null [2]. [ ^^^^^ References: - /node.js:2056:18 - 2056| cb: (error?: Error) => void, + /node.js:2057:18 + 2057| cb: (error?: Error) => void, ^^^^^ [1] stream/stream.js:45:13 45| (error: null); // error @@ -1939,8 +1939,8 @@ Cannot cast `error` to null because undefined [1] is incompatible with null [2]. ^^^^^ References: - /node.js:2056:18 - 2056| cb: (error?: Error) => void, + /node.js:2057:18 + 2057| cb: (error?: Error) => void, ^^^^^ [1] stream/stream.js:45:13 45| (error: null); // error @@ -1983,23 +1983,23 @@ References: stream/stream.js:53:3 53| new MyWriteStream(), // error - first stream must be Readable ^^^^^^^^^^^^^^^^^^^ [1] - /node.js:2041:9 - 2041| s1: stream$Readable, + /node.js:2042:9 + 2042| s1: stream$Readable, ^^^^^^^^^^^^^^^ [2] - /node.js:2046:9 - 2046| s1: stream$Readable, + /node.js:2047:9 + 2047| s1: stream$Readable, ^^^^^^^^^^^^^^^ [3] - /node.js:2052:9 - 2052| s1: stream$Readable, + /node.js:2053:9 + 2053| s1: stream$Readable, ^^^^^^^^^^^^^^^ [4] - /node.js:2059:9 - 2059| s1: stream$Readable, + /node.js:2060:9 + 2060| s1: stream$Readable, ^^^^^^^^^^^^^^^ [5] - /node.js:2067:9 - 2067| s1: stream$Readable, + /node.js:2068:9 + 2068| s1: stream$Readable, ^^^^^^^^^^^^^^^ [6] - /node.js:2076:9 - 2076| s1: stream$Readable, + /node.js:2077:9 + 2077| s1: stream$Readable, ^^^^^^^^^^^^^^^ [7] @@ -2020,20 +2020,20 @@ References: stream/stream.js:60:3 60| new MyWriteStream(), // error - middle stream must be Duplex ^^^^^^^^^^^^^^^^^^^ [1] - /node.js:2047:9 - 2047| s2: stream$Duplex, + /node.js:2048:9 + 2048| s2: stream$Duplex, ^^^^^^^^^^^^^ [2] - /node.js:2053:9 - 2053| s2: stream$Duplex, + /node.js:2054:9 + 2054| s2: stream$Duplex, ^^^^^^^^^^^^^ [3] - /node.js:2060:9 - 2060| s2: stream$Duplex, + /node.js:2061:9 + 2061| s2: stream$Duplex, ^^^^^^^^^^^^^ [4] - /node.js:2068:9 - 2068| s2: stream$Duplex, + /node.js:2069:9 + 2069| s2: stream$Duplex, ^^^^^^^^^^^^^ [5] - /node.js:2077:9 - 2077| s2: stream$Duplex, + /node.js:2078:9 + 2078| s2: stream$Duplex, ^^^^^^^^^^^^^ [6] @@ -2054,20 +2054,20 @@ References: stream/stream.js:68:3 68| new MyReadStream(), // error - last stream must be Writable ^^^^^^^^^^^^^^^^^^ [1] - /node.js:2045:32 - 2045| declare function pipeline( + /node.js:2046:32 + 2046| declare function pipeline( ^^^^^^^^^^^^^^^ [2] - /node.js:2054:9 - 2054| s3: stream$Duplex, + /node.js:2055:9 + 2055| s3: stream$Duplex, ^^^^^^^^^^^^^ [3] - /node.js:2061:9 - 2061| s3: stream$Duplex, + /node.js:2062:9 + 2062| s3: stream$Duplex, ^^^^^^^^^^^^^ [4] - /node.js:2069:9 - 2069| s3: stream$Duplex, + /node.js:2070:9 + 2070| s3: stream$Duplex, ^^^^^^^^^^^^^ [5] - /node.js:2078:9 - 2078| s3: stream$Duplex, + /node.js:2079:9 + 2079| s3: stream$Duplex, ^^^^^^^^^^^^^ [6] @@ -2080,8 +2080,8 @@ Cannot cast `url.parse(...).query` to empty because string [1] is incompatible w ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ References: - /node.js:2252:12 - 2252| query: string | null + /node.js:2253:12 + 2253| query: string | null ^^^^^^ [1] url/url.js:4:50 4| (url.parse('http://example.com/?foo=bar').query: empty); // error, string | null @@ -2097,8 +2097,8 @@ Cannot cast `url.parse(...).query` to empty because null [1] is incompatible wit ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ References: - /node.js:2252:21 - 2252| query: string | null + /node.js:2253:21 + 2253| query: string | null ^^^^ [1] url/url.js:4:50 4| (url.parse('http://example.com/?foo=bar').query: empty); // error, string | null @@ -2114,8 +2114,8 @@ Cannot cast `url.parse(...).query` to empty because object type [1] is incompati ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ References: - /node.js:2257:12 - 2257| query: { [string]: string, ... } + /node.js:2258:12 + 2258| query: { [string]: string, ... } ^^^^^^^^^^^^^^^^^^^^^^^^^ [1] url/url.js:5:56 5| (url.parse('http://example.com/?foo=bar', true).query: empty); // error, object @@ -2131,8 +2131,8 @@ Cannot cast `url.parse(...).query` to empty because string [1] is incompatible w ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ References: - /node.js:2244:12 - 2244| query: string | null | { [string]: string, ... }, + /node.js:2245:12 + 2245| query: string | null | { [string]: string, ... }, ^^^^^^ [1] url/url.js:8:70 8| (url.parse('http://example.com/?foo=bar', parseQueryString).query: empty); // error, string | null | object @@ -2148,8 +2148,8 @@ Cannot cast `url.parse(...).query` to empty because null [1] is incompatible wit ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ References: - /node.js:2244:21 - 2244| query: string | null | { [string]: string, ... }, + /node.js:2245:21 + 2245| query: string | null | { [string]: string, ... }, ^^^^ [1] url/url.js:8:70 8| (url.parse('http://example.com/?foo=bar', parseQueryString).query: empty); // error, string | null | object @@ -2165,8 +2165,8 @@ Cannot cast `url.parse(...).query` to empty because object type [1] is incompati ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ References: - /node.js:2244:28 - 2244| query: string | null | { [string]: string, ... }, + /node.js:2245:28 + 2245| query: string | null | { [string]: string, ... }, ^^^^^^^^^^^^^^^^^^^^^^^^^ [1] url/url.js:8:70 8| (url.parse('http://example.com/?foo=bar', parseQueryString).query: empty); // error, string | null | object