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:
parent
e89a49490c
commit
7d972b4534
2 changed files with 4 additions and 3 deletions
|
@ -1,6 +1,6 @@
|
|||
const globalEval = eval;
|
||||
const window = globalEval("this");
|
||||
window["foo"] = () => {
|
||||
window["denoMain"] = () => {
|
||||
deno_print("Hello world from foo");
|
||||
return "foo";
|
||||
};
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue