Cherry-pick 9b96d6dbdcbf6c8f6270d10c139eb278e8ac312e (support for "for" loops)