I wasn't aware that the benchmark comparison was about micro-templating, it includes libraries like handlebars.
I am sure you realize you can just walk the AST for what identifiers are being used in the template code and forward declare them in the generated code so that reference errors are not caused.