Skip to content

Commit

Permalink
Add support for list.push
Browse files Browse the repository at this point in the history
  • Loading branch information
evilstreak committed Oct 4, 2009
1 parent 86d12b3 commit 46ac835
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions lib/Template.js
Expand Up @@ -118,6 +118,7 @@ Template.VMethods = {
return a < b ? -1 : a > b ? 1 : 0;
});
},
push: function push(x) { this.push(x); },
join: Array.prototype.join,
reverse: Array.prototype.reverse,
size: function size() { return this.length }
Expand Down

1 comment on commit 46ac835

@ashb
Copy link
Owner

@ashb ashb commented on 46ac835 Oct 4, 2009

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is because otherwise the return value of the JS Array.push is given (new number of elements) which isn't the behaviour that TT has.

Please sign in to comment.