diff --git a/lib/node.js b/lib/node.js index 359333db3fa..a556a110ffa 100644 --- a/lib/node.js +++ b/lib/node.js @@ -1282,7 +1282,6 @@ declare class http$Agent { } declare class http$IncomingMessage extends stream$Readable { - destroy(error?: Error): void; headers: Object; rawHeaders: Array; httpVersion: string; @@ -1414,7 +1413,6 @@ declare class net$Socket extends stream$Duplex { bytesRead: number; bytesWritten: number; connect(options: Object, connectListener?: Function): void; - destroy(exception?: Error): void; destroyed: boolean; end( chunk?: string | Buffer, @@ -1673,6 +1671,7 @@ declare class stream$Readable extends stream$Stream { unshift(chunk: Buffer | string): void; push(chunk: ?(Buffer | string), encoding? : string): boolean; wrap(oldReadable: any): stream$Readable; + destroy(error?: Error): this; } type writableStreamOptions = { highWaterMark? : number, decodeString? : boolean, objectMode? : boolean }; @@ -1696,6 +1695,7 @@ declare class stream$Writable extends stream$Stream { encoding: string, callback: (error: ?Error, data?: Buffer | string) => void ): boolean; + destroy(error?: Error): this; } //According to the NodeJS docs: diff --git a/tests/node_tests/node_tests.exp b/tests/node_tests/node_tests.exp index 510fce1df71..c30c5a57f58 100644 --- a/tests/node_tests/node_tests.exp +++ b/tests/node_tests/node_tests.exp @@ -44,17 +44,17 @@ Cannot cast `hmac.read()` to number because: ^^^^^^^^^^^ References: - /node.js:1670:24 - 1670| read(size?: number): ?(string | Buffer); + /node.js:1668:24 + 1668| read(size?: number): ?(string | Buffer); ^^^^^^^^^^^^^^^^^^ [1] crypto/crypto.js:12:21 12| (hmac.read(): number); // 4 errors: null, void, string, Buffer ^^^^^^ [2] - /node.js:1670:26 - 1670| read(size?: number): ?(string | Buffer); + /node.js:1668:26 + 1668| read(size?: number): ?(string | Buffer); ^^^^^^ [3] - /node.js:1670:35 - 1670| read(size?: number): ?(string | Buffer); + /node.js:1668:35 + 1668| read(size?: number): ?(string | Buffer); ^^^^^^ [4] @@ -666,8 +666,8 @@ References: http/server.js:69:15 69| server.listen({}, () => {}, 'localhost', 123); ^^ [1] - /node.js:1330:19 - 1330| listen(port?: number, hostname?: string, backlog?: number, callback?: Function): Server; + /node.js:1329:19 + 1329| listen(port?: number, hostname?: string, backlog?: number, callback?: Function): Server; ^^^^^^ [2] @@ -683,8 +683,8 @@ References: http/server.js:70:15 70| server.listen({}, function() {}, 'localhost', 123); ^^ [1] - /node.js:1330:19 - 1330| listen(port?: number, hostname?: string, backlog?: number, callback?: Function): Server; + /node.js:1329:19 + 1329| listen(port?: number, hostname?: string, backlog?: number, callback?: Function): Server; ^^^^^^ [2] @@ -703,14 +703,14 @@ References: http/server.js:71:15 71| server.listen({}, () => {}, 123); ^^ [1] - /node.js:1330:19 - 1330| listen(port?: number, hostname?: string, backlog?: number, callback?: Function): Server; + /node.js:1329:19 + 1329| listen(port?: number, hostname?: string, backlog?: number, callback?: Function): Server; ^^^^^^ [2] - /node.js:1332:19 - 1332| listen(port?: number, backlog?: number, callback?: Function): Server; + /node.js:1331:19 + 1331| listen(port?: number, backlog?: number, callback?: Function): Server; ^^^^^^ [3] - /node.js:1333:19 - 1333| listen(port?: number, hostname?: string, callback?: Function): Server; + /node.js:1332:19 + 1332| listen(port?: number, hostname?: string, callback?: Function): Server; ^^^^^^ [4] @@ -729,14 +729,14 @@ References: http/server.js:72:15 72| server.listen({}, function() {}, 123); ^^ [1] - /node.js:1330:19 - 1330| listen(port?: number, hostname?: string, backlog?: number, callback?: Function): Server; + /node.js:1329:19 + 1329| listen(port?: number, hostname?: string, backlog?: number, callback?: Function): Server; ^^^^^^ [2] - /node.js:1332:19 - 1332| listen(port?: number, backlog?: number, callback?: Function): Server; + /node.js:1331:19 + 1331| listen(port?: number, backlog?: number, callback?: Function): Server; ^^^^^^ [3] - /node.js:1333:19 - 1333| listen(port?: number, hostname?: string, callback?: Function): Server; + /node.js:1332:19 + 1332| listen(port?: number, hostname?: string, callback?: Function): Server; ^^^^^^ [4] @@ -755,14 +755,14 @@ References: http/server.js:75:15 75| server.listen(() => {}, 'localhost', 123); ^^^^^^^^ [1] - /node.js:1330:19 - 1330| listen(port?: number, hostname?: string, backlog?: number, callback?: Function): Server; + /node.js:1329:19 + 1329| listen(port?: number, hostname?: string, backlog?: number, callback?: Function): Server; ^^^^^^ [2] - /node.js:1332:19 - 1332| listen(port?: number, backlog?: number, callback?: Function): Server; + /node.js:1331:19 + 1331| listen(port?: number, backlog?: number, callback?: Function): Server; ^^^^^^ [3] - /node.js:1333:19 - 1333| listen(port?: number, hostname?: string, callback?: Function): Server; + /node.js:1332:19 + 1332| listen(port?: number, hostname?: string, callback?: Function): Server; ^^^^^^ [4] @@ -781,14 +781,14 @@ References: http/server.js:76:15 76| server.listen(function() {}, 'localhost', 123); ^^^^^^^^^^ [1] - /node.js:1330:19 - 1330| listen(port?: number, hostname?: string, backlog?: number, callback?: Function): Server; + /node.js:1329:19 + 1329| listen(port?: number, hostname?: string, backlog?: number, callback?: Function): Server; ^^^^^^ [2] - /node.js:1332:19 - 1332| listen(port?: number, backlog?: number, callback?: Function): Server; + /node.js:1331:19 + 1331| listen(port?: number, backlog?: number, callback?: Function): Server; ^^^^^^ [3] - /node.js:1333:19 - 1333| listen(port?: number, hostname?: string, callback?: Function): Server; + /node.js:1332:19 + 1332| listen(port?: number, hostname?: string, callback?: Function): Server; ^^^^^^ [4] @@ -804,8 +804,8 @@ References: http/server.js:79:21 79| server.listen(8080, () => {}, 'localhost', 123); ^^^^^^^^ [1] - /node.js:1330:38 - 1330| listen(port?: number, hostname?: string, backlog?: number, callback?: Function): Server; + /node.js:1329:38 + 1329| listen(port?: number, hostname?: string, backlog?: number, callback?: Function): Server; ^^^^^^ [2] @@ -821,8 +821,8 @@ References: http/server.js:80:21 80| server.listen(8080, function() {}, 'localhost', 123); ^^^^^^^^^^ [1] - /node.js:1330:38 - 1330| listen(port?: number, hostname?: string, backlog?: number, callback?: Function): Server; + /node.js:1329:38 + 1329| listen(port?: number, hostname?: string, backlog?: number, callback?: Function): Server; ^^^^^^ [2] @@ -841,14 +841,14 @@ References: http/server.js:81:21 81| server.listen(8080, () => {}, 123); ^^^^^^^^ [1] - /node.js:1330:38 - 1330| listen(port?: number, hostname?: string, backlog?: number, callback?: Function): Server; + /node.js:1329:38 + 1329| listen(port?: number, hostname?: string, backlog?: number, callback?: Function): Server; ^^^^^^ [2] - /node.js:1332:37 - 1332| listen(port?: number, backlog?: number, callback?: Function): Server; + /node.js:1331:37 + 1331| listen(port?: number, backlog?: number, callback?: Function): Server; ^^^^^^ [3] - /node.js:1333:38 - 1333| listen(port?: number, hostname?: string, callback?: Function): Server; + /node.js:1332:38 + 1332| listen(port?: number, hostname?: string, callback?: Function): Server; ^^^^^^ [4] @@ -867,14 +867,14 @@ References: http/server.js:82:21 82| server.listen(8080, function() {}, 123); ^^^^^^^^^^ [1] - /node.js:1330:38 - 1330| listen(port?: number, hostname?: string, backlog?: number, callback?: Function): Server; + /node.js:1329:38 + 1329| listen(port?: number, hostname?: string, backlog?: number, callback?: Function): Server; ^^^^^^ [2] - /node.js:1332:37 - 1332| listen(port?: number, backlog?: number, callback?: Function): Server; + /node.js:1331:37 + 1331| listen(port?: number, backlog?: number, callback?: Function): Server; ^^^^^^ [3] - /node.js:1333:38 - 1333| listen(port?: number, hostname?: string, callback?: Function): Server; + /node.js:1332:38 + 1332| listen(port?: number, hostname?: string, callback?: Function): Server; ^^^^^^ [4] @@ -893,14 +893,14 @@ References: http/server.js:83:21 83| server.listen(8080, () => {}, 'localhost'); ^^^^^^^^ [1] - /node.js:1330:38 - 1330| listen(port?: number, hostname?: string, backlog?: number, callback?: Function): Server; + /node.js:1329:38 + 1329| listen(port?: number, hostname?: string, backlog?: number, callback?: Function): Server; ^^^^^^ [2] - /node.js:1332:37 - 1332| listen(port?: number, backlog?: number, callback?: Function): Server; + /node.js:1331:37 + 1331| listen(port?: number, backlog?: number, callback?: Function): Server; ^^^^^^ [3] - /node.js:1333:38 - 1333| listen(port?: number, hostname?: string, callback?: Function): Server; + /node.js:1332:38 + 1332| listen(port?: number, hostname?: string, callback?: Function): Server; ^^^^^^ [4] @@ -919,14 +919,14 @@ References: http/server.js:84:21 84| server.listen(8080, function() {}, 'localhost'); ^^^^^^^^^^ [1] - /node.js:1330:38 - 1330| listen(port?: number, hostname?: string, backlog?: number, callback?: Function): Server; + /node.js:1329:38 + 1329| listen(port?: number, hostname?: string, backlog?: number, callback?: Function): Server; ^^^^^^ [2] - /node.js:1332:37 - 1332| listen(port?: number, backlog?: number, callback?: Function): Server; + /node.js:1331:37 + 1331| listen(port?: number, backlog?: number, callback?: Function): Server; ^^^^^^ [3] - /node.js:1333:38 - 1333| listen(port?: number, hostname?: string, callback?: Function): Server; + /node.js:1332:38 + 1332| listen(port?: number, hostname?: string, callback?: Function): Server; ^^^^^^ [4] @@ -942,8 +942,8 @@ References: https/server.js:69:15 69| server.listen({}, () => {}, 'localhost', 123); ^^ [1] - /node.js:1371:19 - 1371| listen(port?: number, hostname?: string, backlog?: number, callback?: Function): Server; + /node.js:1370:19 + 1370| listen(port?: number, hostname?: string, backlog?: number, callback?: Function): Server; ^^^^^^ [2] @@ -959,8 +959,8 @@ References: https/server.js:70:15 70| server.listen({}, function() {}, 'localhost', 123); ^^ [1] - /node.js:1371:19 - 1371| listen(port?: number, hostname?: string, backlog?: number, callback?: Function): Server; + /node.js:1370:19 + 1370| listen(port?: number, hostname?: string, backlog?: number, callback?: Function): Server; ^^^^^^ [2] @@ -979,14 +979,14 @@ References: https/server.js:71:15 71| server.listen({}, () => {}, 123); ^^ [1] - /node.js:1371:19 - 1371| listen(port?: number, hostname?: string, backlog?: number, callback?: Function): Server; + /node.js:1370:19 + 1370| listen(port?: number, hostname?: string, backlog?: number, callback?: Function): Server; ^^^^^^ [2] - /node.js:1373:19 - 1373| listen(port?: number, backlog?: number, callback?: Function): Server; + /node.js:1372:19 + 1372| listen(port?: number, backlog?: number, callback?: Function): Server; ^^^^^^ [3] - /node.js:1374:19 - 1374| listen(port?: number, hostname?: string, callback?: Function): Server; + /node.js:1373:19 + 1373| listen(port?: number, hostname?: string, callback?: Function): Server; ^^^^^^ [4] @@ -1005,14 +1005,14 @@ References: https/server.js:72:15 72| server.listen({}, function() {}, 123); ^^ [1] - /node.js:1371:19 - 1371| listen(port?: number, hostname?: string, backlog?: number, callback?: Function): Server; + /node.js:1370:19 + 1370| listen(port?: number, hostname?: string, backlog?: number, callback?: Function): Server; ^^^^^^ [2] - /node.js:1373:19 - 1373| listen(port?: number, backlog?: number, callback?: Function): Server; + /node.js:1372:19 + 1372| listen(port?: number, backlog?: number, callback?: Function): Server; ^^^^^^ [3] - /node.js:1374:19 - 1374| listen(port?: number, hostname?: string, callback?: Function): Server; + /node.js:1373:19 + 1373| listen(port?: number, hostname?: string, callback?: Function): Server; ^^^^^^ [4] @@ -1031,14 +1031,14 @@ References: https/server.js:75:15 75| server.listen(() => {}, 'localhost', 123); ^^^^^^^^ [1] - /node.js:1371:19 - 1371| listen(port?: number, hostname?: string, backlog?: number, callback?: Function): Server; + /node.js:1370:19 + 1370| listen(port?: number, hostname?: string, backlog?: number, callback?: Function): Server; ^^^^^^ [2] - /node.js:1373:19 - 1373| listen(port?: number, backlog?: number, callback?: Function): Server; + /node.js:1372:19 + 1372| listen(port?: number, backlog?: number, callback?: Function): Server; ^^^^^^ [3] - /node.js:1374:19 - 1374| listen(port?: number, hostname?: string, callback?: Function): Server; + /node.js:1373:19 + 1373| listen(port?: number, hostname?: string, callback?: Function): Server; ^^^^^^ [4] @@ -1057,14 +1057,14 @@ References: https/server.js:76:15 76| server.listen(function() {}, 'localhost', 123); ^^^^^^^^^^ [1] - /node.js:1371:19 - 1371| listen(port?: number, hostname?: string, backlog?: number, callback?: Function): Server; + /node.js:1370:19 + 1370| listen(port?: number, hostname?: string, backlog?: number, callback?: Function): Server; ^^^^^^ [2] - /node.js:1373:19 - 1373| listen(port?: number, backlog?: number, callback?: Function): Server; + /node.js:1372:19 + 1372| listen(port?: number, backlog?: number, callback?: Function): Server; ^^^^^^ [3] - /node.js:1374:19 - 1374| listen(port?: number, hostname?: string, callback?: Function): Server; + /node.js:1373:19 + 1373| listen(port?: number, hostname?: string, callback?: Function): Server; ^^^^^^ [4] @@ -1080,8 +1080,8 @@ References: https/server.js:79:21 79| server.listen(8443, () => {}, 'localhost', 123); ^^^^^^^^ [1] - /node.js:1371:38 - 1371| listen(port?: number, hostname?: string, backlog?: number, callback?: Function): Server; + /node.js:1370:38 + 1370| listen(port?: number, hostname?: string, backlog?: number, callback?: Function): Server; ^^^^^^ [2] @@ -1097,8 +1097,8 @@ References: https/server.js:80:21 80| server.listen(8443, function() {}, 'localhost', 123); ^^^^^^^^^^ [1] - /node.js:1371:38 - 1371| listen(port?: number, hostname?: string, backlog?: number, callback?: Function): Server; + /node.js:1370:38 + 1370| listen(port?: number, hostname?: string, backlog?: number, callback?: Function): Server; ^^^^^^ [2] @@ -1117,14 +1117,14 @@ References: https/server.js:81:21 81| server.listen(8443, () => {}, 123); ^^^^^^^^ [1] - /node.js:1371:38 - 1371| listen(port?: number, hostname?: string, backlog?: number, callback?: Function): Server; + /node.js:1370:38 + 1370| listen(port?: number, hostname?: string, backlog?: number, callback?: Function): Server; ^^^^^^ [2] - /node.js:1373:37 - 1373| listen(port?: number, backlog?: number, callback?: Function): Server; + /node.js:1372:37 + 1372| listen(port?: number, backlog?: number, callback?: Function): Server; ^^^^^^ [3] - /node.js:1374:38 - 1374| listen(port?: number, hostname?: string, callback?: Function): Server; + /node.js:1373:38 + 1373| listen(port?: number, hostname?: string, callback?: Function): Server; ^^^^^^ [4] @@ -1143,14 +1143,14 @@ References: https/server.js:82:21 82| server.listen(8443, function() {}, 123); ^^^^^^^^^^ [1] - /node.js:1371:38 - 1371| listen(port?: number, hostname?: string, backlog?: number, callback?: Function): Server; + /node.js:1370:38 + 1370| listen(port?: number, hostname?: string, backlog?: number, callback?: Function): Server; ^^^^^^ [2] - /node.js:1373:37 - 1373| listen(port?: number, backlog?: number, callback?: Function): Server; + /node.js:1372:37 + 1372| listen(port?: number, backlog?: number, callback?: Function): Server; ^^^^^^ [3] - /node.js:1374:38 - 1374| listen(port?: number, hostname?: string, callback?: Function): Server; + /node.js:1373:38 + 1373| listen(port?: number, hostname?: string, callback?: Function): Server; ^^^^^^ [4] @@ -1169,14 +1169,14 @@ References: https/server.js:83:21 83| server.listen(8443, () => {}, 'localhost'); ^^^^^^^^ [1] - /node.js:1371:38 - 1371| listen(port?: number, hostname?: string, backlog?: number, callback?: Function): Server; + /node.js:1370:38 + 1370| listen(port?: number, hostname?: string, backlog?: number, callback?: Function): Server; ^^^^^^ [2] - /node.js:1373:37 - 1373| listen(port?: number, backlog?: number, callback?: Function): Server; + /node.js:1372:37 + 1372| listen(port?: number, backlog?: number, callback?: Function): Server; ^^^^^^ [3] - /node.js:1374:38 - 1374| listen(port?: number, hostname?: string, callback?: Function): Server; + /node.js:1373:38 + 1373| listen(port?: number, hostname?: string, callback?: Function): Server; ^^^^^^ [4] @@ -1195,14 +1195,14 @@ References: https/server.js:84:21 84| server.listen(8443, function() {}, 'localhost'); ^^^^^^^^^^ [1] - /node.js:1371:38 - 1371| listen(port?: number, hostname?: string, backlog?: number, callback?: Function): Server; + /node.js:1370:38 + 1370| listen(port?: number, hostname?: string, backlog?: number, callback?: Function): Server; ^^^^^^ [2] - /node.js:1373:37 - 1373| listen(port?: number, backlog?: number, callback?: Function): Server; + /node.js:1372:37 + 1372| listen(port?: number, backlog?: number, callback?: Function): Server; ^^^^^^ [3] - /node.js:1374:38 - 1374| listen(port?: number, hostname?: string, callback?: Function): Server; + /node.js:1373:38 + 1373| listen(port?: number, hostname?: string, callback?: Function): Server; ^^^^^^ [4] @@ -1426,8 +1426,8 @@ Cannot cast `u1.username` to `Buffer` because string [1] is incompatible with `B ^^^^^^^^^^^ References: - /node.js:1537:13 - 1537| username: string, + /node.js:1535:13 + 1535| username: string, ^^^^^^ [1] os/userInfo.js:7:15 7| (u1.username: Buffer); // error @@ -1443,8 +1443,8 @@ Cannot cast `u2.username` to `Buffer` because string [1] is incompatible with `B ^^^^^^^^^^^ References: - /node.js:1537:13 - 1537| username: string, + /node.js:1535:13 + 1535| username: string, ^^^^^^ [1] os/userInfo.js:11:15 11| (u2.username: Buffer); // error @@ -1460,8 +1460,8 @@ Cannot cast `u3.username` to string because `Buffer` [1] is incompatible with st ^^^^^^^^^^^ References: - /node.js:1529:13 - 1529| username: Buffer, + /node.js:1527:13 + 1527| username: Buffer, ^^^^^^ [1] os/userInfo.js:14:15 14| (u3.username: string); // error