Skip to content

Commit

Permalink
hotfix of js assert accordance
Browse files Browse the repository at this point in the history
  • Loading branch information
InsanusMokrassar committed Nov 18, 2023
1 parent 0b7b408 commit 447e4fe
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/jsMain/kotlin/ExtendedConsole.kt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import kotlin.js.Console
external interface ExtendedConsole : Console {
fun trace()
fun debug(vararg o: Any?)
fun assert(vararg o: Any?)
fun assert(assertion: Boolean, vararg o: Any?)
}

/**
Expand All @@ -16,7 +16,7 @@ fun Console.debug(vararg args: Any?) = unsafeCast<ExtendedConsole>().debug(*args
/**
* [https://developer.mozilla.org/en-US/docs/Web/APtraceI/console/assert_static](https://developer.mozilla.org/en-US/docs/Web/API/console/assert_static)
*/
fun Console.assert(vararg args: Any?) = unsafeCast<ExtendedConsole>().assert(*args)
fun Console.assert(assertion: Boolean, vararg args: Any?) = unsafeCast<ExtendedConsole>().assert(assertion, *args)

/**
* [https://developer.mozilla.org/en-US/docs/Web/API/console/trace_static](https://developer.mozilla.org/en-US/docs/Web/API/console/trace_static)
Expand Down
2 changes: 1 addition & 1 deletion src/jsMain/kotlin/KSLoggerDefaultPlatformLoggerLambda.kt
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@ actual var KSLoggerDefaultPlatformLoggerLambda: (level: LogLevel, tag: String, m
LogLevel.INFO -> console.info(*args)
LogLevel.WARNING -> console.warn(*args)
LogLevel.ERROR -> console.error(*args)
LogLevel.ASSERT -> console.assert(*args)
LogLevel.ASSERT -> console.error(*args)
}
}

0 comments on commit 447e4fe

Please sign in to comment.