Avoid modifying the default resources limits hash.

This commit is contained in:
Dylan Thacker-Smith
2014-10-01 18:51:06 -05:00
parent 23622a9739
commit cf5ccede50
2 changed files with 13 additions and 1 deletions

View File

@@ -21,7 +21,7 @@ module Liquid
@scopes = [(outer_scope || {})]
@registers = registers
@errors = []
@resource_limits = resource_limits || Template.default_resource_limits
@resource_limits = resource_limits || Template.default_resource_limits.dup
@resource_limits[:render_score_current] = 0
@resource_limits[:assign_score_current] = 0
@parsed_expression = Hash.new{ |cache, markup| cache[markup] = Expression.parse(markup) }