1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-11-21 15:04:11 -05:00

Fix deno executable

This commit is contained in:
Ryan Dahl 2018-06-11 22:29:34 +02:00
parent e89a49490c
commit 7d972b4534
2 changed files with 4 additions and 3 deletions

View file

@ -1,6 +1,6 @@
const globalEval = eval;
const window = globalEval("this");
window["foo"] = () => {
window["denoMain"] = () => {
deno_print("Hello world from foo");
return "foo";
};

View file

@ -9,9 +9,10 @@ int main(int argc, char** argv) {
deno_init();
Deno* d = deno_new(NULL, NULL);
int r = deno_load(d, "main2.js", "foo();");
if (r != 0) {
bool r = deno_execute(d, "deno_main.js", "denoMain();");
if (!r) {
printf("Error! %s\n", deno_last_exception(d));
exit(1);
}
deno_dispose(d);
}