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
Yet, if we look at the FuzzIL representation, we see that the Compiler didn't use v1 for console.log but v2 instead, which is unnecessary.
The problem is that the map function maps the identifier a to a FuzzIL variable in the most recently opened scope, i.e. the BlockStatement. Outside of the BlockStatement lookupIdentifier doesn't find the FuzzIL variable anymore and therefore creates a new one.
I assume that the map function works correctly for variable declarations of the let and const type but not for globals or var. I would propose giving the map function a parameter that controls in which scope on the stack the identifier should be saved instead of just using scopes.top.
The text was updated successfully, but these errors were encountered:
Here is a problem
sample.js
is identical to liftToJS(compile(sample.js))
Yet, if we look at the FuzzIL representation, we see that the Compiler didn't use
v1
forconsole.log
butv2
instead, which is unnecessary.The problem is that the map function maps the identifier
a
to a FuzzIL variable in the most recently opened scope, i.e. the BlockStatement. Outside of the BlockStatementlookupIdentifier
doesn't find the FuzzIL variable anymore and therefore creates a new one.I assume that the map function works correctly for variable declarations of the let and const type but not for globals or var. I would propose giving the map function a parameter that controls in which scope on the stack the identifier should be saved instead of just using
scopes.top
.The text was updated successfully, but these errors were encountered: