Files
kotlin-fork/js/js.translator/testData/box/native/print.js
T
2017-04-11 16:15:25 +03:00

31 lines
565 B
JavaScript
Vendored

var buffer = "";
function writeToBuffer(a) {
var type = typeof a;
if (type === "undefined") return;
if (type !== "string" && !(a instanceof String)) throw Error("Expected string argument type, but got: " + type);
buffer += a;
}
function writelnToBuffer(a) {
writeToBuffer(a);
writeToBuffer("\n");
}
var GLOBAL = (0, eval)("this");
GLOBAL.console = {
log: function (a) {
if (typeof a !== "undefined") {
buffer += a
}
buffer += "\n";
}
};
GLOBAL.outputStream = {
write: writeToBuffer
};