|
30 | 30 |
|
31 | 31 | /* global BUNDLE_VERSION, BUNDLE_LIBRARY, BUNDLE_DEFINITIONS */
|
32 | 32 |
|
33 |
| -// Use "." instead of "/" as cwd in browsers |
34 |
| -if (process.browser) process.cwd = function() { return "."; }; |
35 |
| - |
36 | 33 | const fs = require("fs");
|
37 | 34 | const path = require("path");
|
| 35 | +const process = require("process"); // ensure shim |
| 36 | + |
38 | 37 | const utf8 = require("./util/utf8");
|
39 | 38 | const colorsUtil = require("./util/colors");
|
40 | 39 | const optionsUtil = require("./util/options");
|
41 | 40 | const mkdirp = require("./util/mkdirp");
|
42 | 41 | const find = require("./util/find");
|
| 42 | +const binaryen = global.binaryen || (global.binaryen = require("binaryen")); |
| 43 | + |
43 | 44 | const EOL = process.platform === "win32" ? "\r\n" : "\n";
|
44 | 45 | const SEP = process.platform === "win32" ? "\\" : "/";
|
45 |
| -const binaryen = global.binaryen || (global.binaryen = require("binaryen")); |
46 | 46 |
|
47 | 47 | // Sets up an extension with its definition counterpart and relevant regexes.
|
48 | 48 | function setupExtension(extension) {
|
@@ -351,8 +351,6 @@ exports.main = function main(argv, options, callback) {
|
351 | 351 |
|
352 | 352 | // returns a relative path from baseDir
|
353 | 353 | function makeRelative(arg) {
|
354 |
| - // FIXME: see https://github.com/AssemblyScript/assemblyscript/issues/1398 |
355 |
| - if (baseDir === ".") return arg; |
356 | 354 | return path.relative(baseDir, arg);
|
357 | 355 | }
|
358 | 356 |
|
@@ -1109,8 +1107,6 @@ function createStats() {
|
1109 | 1107 |
|
1110 | 1108 | exports.createStats = createStats;
|
1111 | 1109 |
|
1112 |
| -if (!process.hrtime) process.hrtime = require("browser-process-hrtime"); |
1113 |
| - |
1114 | 1110 | /** Measures the execution time of the specified function. */
|
1115 | 1111 | function measure(fn) {
|
1116 | 1112 | const start = process.hrtime();
|
|
0 commit comments