Improve bundled asc example a bit, see #25

This commit is contained in:
dcodeIO
2018-02-09 16:40:53 +01:00
parent 60728c38fd
commit 08d9ba12aa
3 changed files with 20 additions and 9 deletions

View File

@ -44,6 +44,7 @@ function main(argv, options, callback) {
const readFile = options.readFile || readFileNode;
const writeFile = options.writeFile || writeFileNode;
const listFiles = options.listFiles || listFilesNode;
const stats = options.stats || createStats();
// All of the above must be specified in browser environments
if (!stdout) throw Error("'options.stdout' must be specified");
@ -54,9 +55,6 @@ function main(argv, options, callback) {
if (listFiles === listFilesNode) throw Error("'options.listFiles' must be specified");
}
// Record compilation times
const stats = createStats();
const args = parseArguments(argv);
const indent = 24;
@ -507,6 +505,8 @@ function createStats() {
};
}
exports.createStats = createStats;
if (!process.hrtime)
process.hrtime = require("browser-process-hrtime");