webassembly: Support piping in a program on stdin.

The performance benchmark suite can now be run on the webassembly port.

Signed-off-by: Damien George <damien@micropython.org>
This commit is contained in:
Damien George 2022-11-03 17:37:38 +11:00
parent 7a505d57dc
commit 2d406f2226

View File

@ -56,6 +56,12 @@ var mainProgram = function()
repl = false;; repl = false;;
} }
} }
if (process.stdin.isTTY === false) {
contents = fs.readFileSync(0, 'utf8');
repl = 0;
}
mp_js_init(heap_size); mp_js_init(heap_size);
if (repl) { if (repl) {