Skip to content
This repository was archived by the owner on Jul 30, 2024. It is now read-only.

Commit e904b4c

Browse files
authored
Merge pull request #116 from exoego/function-objects
util.promisify is now function object with custom property
2 parents 6e21996 + 50539e8 commit e904b4c

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

app/current/src/main/scala/io/scalajs/nodejs/util/Util.scala

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,7 @@ trait Util extends js.Object {
5656

5757
def callbackify[T](original: js.Function): js.Function2[js.Any, T, Any] = js.native
5858

59-
def promisify(original: js.Function): js.Function = js.native
60-
val promisify: PromisifyObject = js.native
59+
val promisify: PromisifyObject = js.native
6160

6261
@enableIf(io.scalajs.nodejs.internal.CompilerSwitches.gteNodeJs10)
6362
val types: UtilTypes = js.native
@@ -83,7 +82,7 @@ trait InspectObject extends js.Function2[js.Any, InspectOptions, String] with js
8382
}
8483

8584
@js.native
86-
trait PromisifyObject extends js.Object {
85+
trait PromisifyObject extends js.Function1[js.Function, js.Function] {
8786
val custom: js.Symbol = js.native
8887
}
8988

app/nodejs-v8/src/test/scala/io/scalajs/nodejs/util/UtilTest.scala

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ class UtilTest extends FunSpec {
1616
}
1717

1818
it("have promisify") {
19-
assert(Util.promisify.custom !== null)
19+
assert(js.typeOf(Util.promisify(() => "")) === "function")
20+
assert(js.typeOf(Util.promisify.custom) === "symbol")
2021
}
2122

2223
it("have TextEncoder/TextDecoder") {

0 commit comments

Comments
 (0)