You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Original function returns ['undefined', 'undefined'] whereas output function returns ['object', 'object']. This is because eval() can access the temp vars which don't exist in the original.
The temp vars can be removed, solving this problem, by outputting:
In this simple case where there are no other vars defined in the file, and output is ESM format (so no module or exports vars), output could also be identical to input. There's no need for (eval, 0)(...) wrapper, because there are no local vars to shield the eval() code from.
The text was updated successfully, but these errors were encountered:
overlookmotel
changed the title
Functions containing eval() where this or arguments are accessible allows eval() code to see Livepack's intermediate vars
Functions containing eval() where this or arguments are accessible allows eval() code to access temp vars
Jan 2, 2023
Input:
Current output:
Original function returns
['undefined', 'undefined']
whereas output function returns['object', 'object']
. This is becauseeval()
can access the temp vars which don't exist in the original.The temp vars can be removed, solving this problem, by outputting:
or even something very close to the original:
In this simple case where there are no other vars defined in the file, and output is ESM format (so no
module
orexports
vars), output could also be identical to input. There's no need for(eval, 0)(...)
wrapper, because there are no local vars to shield theeval()
code from.The text was updated successfully, but these errors were encountered: