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

util.promisify is now function object with custom property #116

Merged
merged 1 commit into from
Oct 11, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions app/current/src/main/scala/io/scalajs/nodejs/util/Util.scala
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,7 @@ trait Util extends js.Object {

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

def promisify(original: js.Function): js.Function = js.native
val promisify: PromisifyObject = js.native
val promisify: PromisifyObject = js.native

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

@js.native
trait PromisifyObject extends js.Object {
trait PromisifyObject extends js.Function1[js.Function, js.Function] {
val custom: js.Symbol = js.native
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ class UtilTest extends FunSpec {
}

it("have promisify") {
assert(Util.promisify.custom !== null)
assert(js.typeOf(Util.promisify(() => "")) === "function")
assert(js.typeOf(Util.promisify.custom) === "symbol")
}

it("have TextEncoder/TextDecoder") {
Expand Down