[quickjs-devel] Partially eval script excluding global code

  • From: JM <jeevhi@xxxxxxxxx>
  • To: quickjs-devel@xxxxxxxxxxxxx
  • Date: Sat, 18 Jan 2020 15:18:35 +0530

Hi, Is it possible to eval the script excluding the global code? I am
essentially trying to load scripts with functions that can be called later.
However, if script has any global statement, I do not want them to be
executed. I need to do this at runtime since the scripts will be loaded by
users.

For example,  if I have script like this

function myFunction() {  <--- this can be called later

}

x = 1 + 2; <----- this should not be executed

Other related posts: