From 7a695c8bed1a13c0973fd3c2f38c82865298271e Mon Sep 17 00:00:00 2001 From: exoego Date: Mon, 23 Mar 2020 13:18:40 +0900 Subject: [PATCH 1/2] Return this.type https://nodejs.org/dist/latest-v12.x/docs/api/stream.html#stream_writable_end_chunk_encoding_callback --- .../main/scala/io/scalajs/nodejs/stream/Stream.scala | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/app/current/src/main/scala/io/scalajs/nodejs/stream/Stream.scala b/app/current/src/main/scala/io/scalajs/nodejs/stream/Stream.scala index 5fd42c075..688df8b2d 100644 --- a/app/current/src/main/scala/io/scalajs/nodejs/stream/Stream.scala +++ b/app/current/src/main/scala/io/scalajs/nodejs/stream/Stream.scala @@ -267,13 +267,12 @@ sealed trait IWritable extends LegacyStream { def destroyed: Boolean = js.native - // TODO: Return type should be this.type if node.js v8 dropped - def end(chunk: String | Uint8Array, callback: js.Function1[Error, Any]): js.UndefOr[this.type] = js.native - def end(chunk: String | Uint8Array): js.UndefOr[this.type] = js.native + def end(chunk: String | Uint8Array, callback: js.Function1[Error, Any]): this.type = js.native + def end(chunk: String | Uint8Array): js.UndefOr[this.type] = js.native - def end(chunk: String, encoding: String, callback: js.Function1[Error, Any]): js.UndefOr[this.type] = js.native - def end(chunk: String, encoding: String): js.UndefOr[this.type] = js.native - def end(callback: js.Function1[Error, Any] = js.native): js.UndefOr[this.type] = js.native + def end(chunk: String, encoding: String, callback: js.Function1[Error, Any]): this.type = js.native + def end(chunk: String, encoding: String): this.type = js.native + def end(callback: js.Function1[Error, Any] = js.native): this.type = js.native /** * Sets the default encoding for a writable stream. From 9c3e1b97b8726f08eb4c240d0607dadfacb9cdee Mon Sep 17 00:00:00 2001 From: exoego Date: Mon, 23 Mar 2020 13:19:25 +0900 Subject: [PATCH 2/2] Return Int https://nodejs.org/dist/latest-v12.x/docs/api/os.html#os_os_uptime --- app/current/src/main/scala/io/scalajs/nodejs/os/OS.scala | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/app/current/src/main/scala/io/scalajs/nodejs/os/OS.scala b/app/current/src/main/scala/io/scalajs/nodejs/os/OS.scala index d3eae5e18..e95b0493c 100644 --- a/app/current/src/main/scala/io/scalajs/nodejs/os/OS.scala +++ b/app/current/src/main/scala/io/scalajs/nodejs/os/OS.scala @@ -133,8 +133,7 @@ trait OS extends js.Object { * Returns the system uptime in seconds. * @example os.uptime() */ - // TODO: Return type should be Int after dropping Node.js 8 (Windows returns decimal until Node.js 10)) - def uptime(): Double = js.native + def uptime(): Int = js.native /** * The os.userInfo() method returns information about the currently effective user -- on POSIX platforms,