Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Added frame variables reference support in 'set'.

  • Loading branch information...
commit d7909d4349c3f486e8396a65d77f77e5eeb788dc 1 parent 3592f7f
@panta panta authored
Showing with 7 additions and 1 deletion.
  1. +1 −1  src/compiler.js
  2. +6 −0 tests/compiler.js
View
2  src/compiler.js
@@ -276,7 +276,7 @@ var Compiler = Object.extend({
var id = this.tmpid();
this.emit('var ' + id + ' = ');
- this._compileExpression(node.value);
+ this._compileExpression(node.value, frame);
this.emitLine(';');
for(var i=0; i<node.targets.length; i++) {
View
6 tests/compiler.js
@@ -315,6 +315,12 @@ describe('compiler', function() {
s.should.equal('bar');
});
+ it('should compile set with frame references', function() {
+ var s = render('{% set username = user.name %}{{ username }}',
+ { user: { name: 'james' } });
+ s.should.equal('james');
+ });
+
it('should throw errors', function() {
(function() {
render('{% from "import.html" import boozle %}');
Please sign in to comment.
Something went wrong with that request. Please try again.