diff --git a/js/js.libraries/src/core/javaio.kt b/js/js.libraries/src/core/javaio.kt index a5fd8ed741e..5bfe30234a4 100644 --- a/js/js.libraries/src/core/javaio.kt +++ b/js/js.libraries/src/core/javaio.kt @@ -2,3 +2,8 @@ package java.io library public class IOException(message: String = "") : Exception() {} + +library +public trait Closeable { + public open fun close() : Unit; +} diff --git a/js/js.translator/testFiles/kotlin_lib.js b/js/js.translator/testFiles/kotlin_lib.js index edcc2b741a0..540267ac256 100644 --- a/js/js.translator/testFiles/kotlin_lib.js +++ b/js/js.translator/testFiles/kotlin_lib.js @@ -248,6 +248,12 @@ var kotlin = {set:function (receiver, key, value) { append: throwAbstractFunctionInvocationError("Appendable#append") }); + Kotlin.Closeable = Kotlin.$createClass({ + initialize: function () { + }, + close: throwAbstractFunctionInvocationError("Closeable#close") + }); + Kotlin.parseInt = function (str) { return parseInt(str, 10); };