mirror of
https://github.com/fluencelabs/assemblyscript
synced 2025-06-30 15:11:45 +00:00
Initial asc browser bundle, see #25
This commit is contained in:
@ -46,8 +46,9 @@ tests.forEach(filename => {
|
||||
|
||||
const basename = filename.replace(/\.ts$/, "");
|
||||
|
||||
const stdout = createMemoryStream();
|
||||
const stderr = createMemoryStream(true);
|
||||
const stdout = asc.createMemoryStream();
|
||||
const stderr = asc.createMemoryStream(chunk => process.stderr.write(chunk.toString().replace(/^(?!$)/mg, " ")));
|
||||
stderr.isTTY = true;
|
||||
|
||||
var failed = false;
|
||||
|
||||
@ -135,28 +136,6 @@ tests.forEach(filename => {
|
||||
});
|
||||
});
|
||||
|
||||
function createMemoryStream(print) {
|
||||
var stream = [];
|
||||
if (stream.print = print)
|
||||
stream.isTTY = process.stderr.isTTY;
|
||||
stream.write = function(chunk) {
|
||||
if (typeof chunk === "string") {
|
||||
this.push(Buffer.from(chunk, "utf8"));
|
||||
} else {
|
||||
this.push(chunk);
|
||||
}
|
||||
if (stream.print)
|
||||
process.stderr.write(chunk.toString().replace(/^(?!$)/mg, " "));
|
||||
};
|
||||
stream.toBuffer = function() {
|
||||
return Buffer.concat(this);
|
||||
};
|
||||
stream.toString = function() {
|
||||
return this.toBuffer().toString("utf8");
|
||||
};
|
||||
return stream;
|
||||
}
|
||||
|
||||
if (failures) {
|
||||
process.exitCode = 1;
|
||||
console.log(chalk.red("ERROR: ") + failures + " compiler tests failed");
|
||||
|
Reference in New Issue
Block a user