Skip to content

Commit

Permalink
fix(for): Remove non-standard for_loop variable
Browse files Browse the repository at this point in the history
`for` loops provided both a `forloop` and `for_loop` variable, only the
former being shopify compatible.

BREAKING CHANGE: Change `for_loop` to `forloop`.
  • Loading branch information
epage committed Dec 16, 2017
1 parent 30064f0 commit 0d9515f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/tags/for_block.rs
Original file line number Diff line number Diff line change
Expand Up @@ -97,10 +97,10 @@ impl Renderable for For {
helper_vars.insert("first".to_owned(), Value::Bool(i == 0));
helper_vars.insert("last".to_owned(), Value::Bool(i == (range_len - 1)));

scope.set_local_val("for_loop", Value::Object(helper_vars.clone()));
scope.set_local_val("forloop", Value::Object(helper_vars.clone()));
scope.set_local_val(&self.var_name, v.clone());
let inner = try!(self.item_template.render(&mut scope))
let inner = self.item_template
.render(&mut scope)?
.unwrap_or_else(String::new);
ret = ret + &inner;

Expand Down

0 comments on commit 0d9515f

Please sign in to comment.