This commit is contained in:
blueloveTH 2023-02-06 20:53:22 +08:00
parent 9f01810981
commit a37ee9d556
2 changed files with 9 additions and 0 deletions

View File

@ -1,3 +1,8 @@
## 0.8.1
+ Bug fix
+ Add `vm.bind<T>` support
## 0.8.0+2 ## 0.8.0+2
+ add complete reflection (exec/eval/getattr/setattr/hasattr) + add complete reflection (exec/eval/getattr/setattr/hasattr)

View File

@ -123,6 +123,10 @@ vm.exec(code);
var _o = vm.read_output(); var _o = vm.read_output();
print(_o.stdout) // "Hello world!\n" print(_o.stdout) // "Hello world!\n"
print(_o.stderr) // "" print(_o.stderr) // ""
// Create a binding
vm.bind<int>("builtins", "add", (int x, int y) => x + y);
vm.eval("add(1, 2)"); // '3'
``` ```