Caleb Cox
Caleb Cox
DDeno
Created by Caleb Cox on 10/3/2024 in #help
Iterator is not defined when creating a snapshot with init_ops_and_esm
I was able to work around this by rewriting my runtime.js script to use generators:
const lines = function* () {
while (true) {
const line = Deno.core.ops.op_stdin_line();
if (line === null) {
return;
}
yield line;
}
};


globalThis.stdin = lines();
const lines = function* () {
while (true) {
const line = Deno.core.ops.op_stdin_line();
if (line === null) {
return;
}
yield line;
}
};


globalThis.stdin = lines();
3 replies