allow modules in repl
the recommended way to import libraries is now import Lib from "...";
, but it doesn't work in the repl:
gjs> import GLib from "gi://GLib";
typein:1:0 SyntaxError: import declarations may only appear at top level of a module:
typein:1:0 import GLib from "gi://GLib";
typein:1:0 ^
also awaiting stuff failes with the same error:
gjs> await {then: (resolve) => resolve("a.")}
typein:2:0 SyntaxError: await is only valid in async functions, async generators and modules:
typein:2:0 await {then: (resolve) => resolve("a.")}
typein:2:0 ^
while in node and firefox:
> await {then: (resolve) => resolve("a.")}
'a.'
>