Shopify/liquid — pull request #377 by tjoyal (2014-07-07 20:38:28+00:00)
Title: Fix include in strict mode errors

Regression introduced by https://github.com/Shopify/liquid/commit/2bac6267f9fb6f341f77ee6aaf02cb17dd8e09cf

The specified commit introduced a regression on the include tag where when used add to error list mentioning the variable named after the snipped being included is absent. `"Variable {{nested_template}} not found"`

This is due to the include tag copying over variable from one context to the other AND the magic where if not specified the `with` parameter is defaulted to the template name.

The fix proposed it to check if the variable exists (via `has_key?`) before actually accessing it.

Side problem: `has_key?` added an error when the key was not available.... So the proposition is to run `has_key?` within `:lax` mode. Either it was that or passing an ignore_error flag down the method chain. Alternate propositions would be appreciated if any exists.

Either accepting this PR or rollbacking the specified commit would be in my mind an acceptable solution.

Thoughts?

cc: @sgnr @fw42