mirror of
https://github.com/fluencelabs/assemblyscript
synced 2025-06-20 02:11:31 +00:00
fix rc in Array#fill, add rtti logging for debugging
This commit is contained in:
12
cli/asc.js
12
cli/asc.js
@ -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) };
|
||||
|
@ -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",
|
||||
|
Reference in New Issue
Block a user