Added global context

I guess this discussion is really opinion-based, so we shouldn't discuss this.

After all, a `for` loop seems to be the right choice to me, as you can `for (cur = stack; cur.value.type; cur++) {` here.