Advertisement
Guest User

Untitled

a guest
Jun 8th, 2017
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.34 KB | None | 0 0
  1. #include <stdio.h>
  2. #include "mujs/mujs.h"
  3.  
  4. int main() {
  5.   js_State *js;
  6.  
  7.   js = js_newstate(NULL, NULL, JS_STRICT);
  8.   js_loadstring(js,"myscript", "var arr=[1,2,3];");
  9.   js_pushundefined(js);
  10.   js_pcall(js, 0);
  11.   js_getglobal(js, "arr");
  12.   // js_delindex(js, -1, 2);
  13.   js_getindex(js, -1, 2);
  14.   printf("Value: %s\n", js_tostring(js, 2));
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement