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
This seems to be related to the fact that we execute nodes in order, instead of having a special category for this. These functions should be evaluated first, and then start evaluating the rest of statements.
I don't think v0.9.0 is realistic for this, for hoisting to work would require a big refactor of how execution works, including having some pre-parsing step.
I don't think v0.9.0 is realistic for this, for hoisting to work would require a big refactor of how execution works, including having some pre-parsing step.
We're no where near that point yet.
Actually, this seems to be already working in #392. The Idea was to re-order function declarations to show before all the rest of the nodes in the node list. Not sure what else should be done.
Activity
Razican commentedon May 7, 2020
This seems to be related to the fact that we execute nodes in order, instead of having a special category for this. These functions should be evaluated first, and then start evaluating the rest of statements.
jasonwilliams commentedon May 18, 2020
I don't think v0.9.0 is realistic for this, for hoisting to work would require a big refactor of how execution works, including having some pre-parsing step.
We're no where near that point yet.
Razican commentedon May 18, 2020
Actually, this seems to be already working in #392. The Idea was to re-order function declarations to show before all the rest of the nodes in the node list. Not sure what else should be done.
jasonwilliams commentedon May 18, 2020
oh ok interesting.
Should we be doing something more closely related to https://v8.dev/blog/preparser#variable-allocation? is reordering sound?
Razican commentedon May 18, 2020
Definitelly, but I think it's a reasonable workaround in the meantime.
It should be, it's slower, as we will be doing a sort, but it's always maintaining ordering, so it's sound as far as I can tell.