summaryrefslogtreecommitdiff
path: root/deno2/main.cc
blob: 2c0b1b2983de182fe86a8c370018107bbcfde68f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
// Copyright 2018 Ryan Dahl <ry@tinyclouds.org>
// All rights reserved. MIT License.
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>

#include "include/deno.h"

int main(int argc, char** argv) {
  deno_init();

  Deno* d = deno_new(NULL, NULL);
  bool r = deno_execute(d, "deno_main.js", "denoMain();");
  if (!r) {
    printf("Error! %s\n", deno_last_exception(d));
    exit(1);
  }
  deno_delete(d);
}