fix rc in Array#fill, add rtti logging for debugging

This commit is contained in:
dcode
2019-06-01 15:57:53 +02:00
parent 066ea1fbd2
commit 1468923025
15 changed files with 129 additions and 65 deletions

View File

@ -711,6 +711,9 @@ exports.main = function main(argv, options, callback) {
if (args.measure) {
printStats(stats, stderr);
}
if (args.printrtti) {
printRTTI(program, stderr);
}
return callback(null);
function readFileNode(filename, baseDir) {
@ -847,6 +850,15 @@ function printStats(stats, output) {
exports.printStats = printStats;
/** Prints runtime type information. */
function printRTTI(program, output) {
if (!output) output = process.stderr;
output.write("# Runtime type information (RTTI)\n");
output.write(assemblyscript.buildRTTI(program));
}
exports.printRTTI = printRTTI;
var allocBuffer = typeof global !== "undefined" && global.Buffer
? global.Buffer.allocUnsafe || function(len) { return new global.Buffer(len); }
: function(len) { return new Uint8Array(len) };

View File

@ -185,6 +185,11 @@
"type": "b",
"default": false
},
"printrtti": {
"description": "Prints the module's runtime type information to stderr.",
"type": "b",
"default": false
},
"noColors": {
"description": "Disables terminal colors.",
"type": "b",