浏览代码

Fix api example

bynect 4 年之前
父节点
当前提交
a4465f8d1f
共有 2 个文件被更改,包括 2 次插入2 次删除
  1. 1 1
      api/exec_c.c
  2. 1 1
      api/exec_gravity.c

+ 1 - 1
api/exec_c.c

@@ -152,7 +152,7 @@ int main(int argc, const char * argv[]) {
 
     // compile source into a closure
     gravity_compiler_t *compiler = gravity_compiler_create(&delegate);
-    gravity_closure_t *closure = gravity_compiler_run(compiler, source, strlen(source), 0, true);
+    gravity_closure_t *closure = gravity_compiler_run(compiler, source, strlen(source), 0, true, true);
     if (!closure) return -1;
 
     // setup a new VM and a new fiber

+ 1 - 1
api/exec_gravity.c

@@ -42,7 +42,7 @@ int main(int argc, const char * argv[]) {
 
     // compile source into a closure
     gravity_compiler_t *compiler = gravity_compiler_create(&delegate);
-    gravity_closure_t *closure = gravity_compiler_run(compiler, source, strlen(source), 0, true);
+    gravity_closure_t *closure = gravity_compiler_run(compiler, source, strlen(source), 0, true, true);
     if (!closure) return -1;
 
     // setup a new VM and a new fiber