rogchap / v8go

Execute JavaScript from Go

Home Page:https://rogchap.com/v8go

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Question: Accessing global variables after each script execution

mustafaakin opened this issue · comments

I'm trying to build Jupyter-notebook like application with v8 isolates. I'm writing it in Go, but I know it's not specfic to Go, but V8 isolates.

Consider I run the following code:

let users = [1,2,3]
let mappedUsers = users.map(a => a*3)

After this execution, how can I access these variables created globally, meaning I don't know the script contents so how can I iterate them properly? This might be a debugger case, and I might be confusing some use cases, but any pointers would be appreciated.

exec js
return users
return mappedUsers