Skip to content

Commit 6fd3cd0

Browse files
committed
added support for java.io.Closeable as a standard interface
1 parent b25c27b commit 6fd3cd0

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

js/js.libraries/src/core/javaio.kt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,8 @@ package java.io
22

33
library
44
public class IOException(message: String = "") : Exception() {}
5+
6+
library
7+
public trait Closeable {
8+
public open fun close() : Unit;
9+
}

js/js.translator/testFiles/kotlin_lib.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,12 @@ var kotlin = {set:function (receiver, key, value) {
248248
append: throwAbstractFunctionInvocationError("Appendable#append")
249249
});
250250

251+
Kotlin.Closeable = Kotlin.$createClass({
252+
initialize: function () {
253+
},
254+
close: throwAbstractFunctionInvocationError("Closeable#close")
255+
});
256+
251257
Kotlin.parseInt = function (str) {
252258
return parseInt(str, 10);
253259
};

0 commit comments

Comments
 (0)