Skip to content

Commit

Permalink
remove Array.clear
Browse files Browse the repository at this point in the history
  • Loading branch information
anthias committed Dec 18, 2015
1 parent 1d22a89 commit 21b1589
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 9 deletions.
2 changes: 1 addition & 1 deletion source/block.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Liquid.Block = Liquid.Tag.extend({
// share this through pointers; specifically If points _nodelist at the
// blocks attachment, so we need to leave that pointer to pickup stuff.
if (!this.nodelist) this.nodelist = [];
this.nodelist.clear();
this.nodelist.length = 0;

var token = tokens.shift();
tokens.push(''); // To ensure we don't lose the last token passed in...
Expand Down
2 changes: 1 addition & 1 deletion source/default_tags.js
Original file line number Diff line number Diff line change
Expand Up @@ -460,7 +460,7 @@ Liquid.Template.registerTag( 'raw', Liquid.Block.extend({
// to render directly (rather than parsing them) until we reach {% endraw %}
parse: function(tokens) {
if (!this.nodelist) this.nodelist = [];
this.nodelist.clear();
this.nodelist.length = 0;

var token = tokens.shift();
tokens.push('');
Expand Down
7 changes: 0 additions & 7 deletions source/extensions.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,6 @@ if (!Array.prototype.indexOf) {
};
}

// Array.clear
if (!Array.prototype.clear) {
Array.prototype.clear = function() {
//while (this.length > 0) this.pop();
this.length = 0;
};
}

// Array.map
if (!Array.prototype.map) {
Expand Down

0 comments on commit 21b1589

Please sign in to comment.