Skip to content

Commit

Permalink
Merge pull request #756 from jenseng/mapfix
Browse files Browse the repository at this point in the history
fix bug in IE<=8 (no Array::map), closes #751
  • Loading branch information
kpdecker committed Mar 5, 2014
2 parents fd5dfc8 + 5999baf commit 674d07f
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions lib/handlebars/compiler/javascript-compiler.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,12 +83,13 @@ JavaScriptCompiler.prototype = {

this.compileChildren(environment, options);

var opcodes = environment.opcodes, opcode;
var opcodes = environment.opcodes,
opcode,
i,
l;

this.i = 0;

for(var l=opcodes.length; this.i<l; this.i++) {
opcode = opcodes[this.i];
for (i = 0, l = opcodes.length; i < l; i++) {
opcode = opcodes[i];

if(opcode.opcode === 'DECLARE') {
this[opcode.name] = opcode.value;
Expand All @@ -115,11 +116,12 @@ JavaScriptCompiler.prototype = {
compiler: this.compilerInfo(),
main: fn
};
this.context.programs.map(function(program, index) {
if (program) {
ret[index] = program;
var programs = this.context.programs;
for (i = 0, l = programs.length; i < l; i++) {
if (programs[i]) {
ret[i] = programs[i];
}
});
}

if (this.environment.usePartial) {
ret.usePartial = true;
Expand Down

0 comments on commit 674d07f

Please sign in to comment.