Skip to content

Implement strict and assumeObject modes#932

Merged
kpdecker merged 1 commit intomasterfrom
strict
Jan 1, 2015
Merged

Implement strict and assumeObject modes#932
kpdecker merged 1 commit intomasterfrom
strict

Conversation

@kpdecker
Copy link
Copy Markdown
Collaborator

Causes templates to throw when lookup fields are not defined within the
context. Strict mode will throw when any field is omitted. assumeObjects mode
maintains the existing behavior of outputting an empty response when fields
are not defined but allows for performance/size optimizations by not doing
safety checks for intermediate objects in the lookup chain.

Strict mode effectively disables the helperMissing and inverse handling for
blockHelperMissing as templates will throw rather than call those features for
missing data fields.

Fixes #651 Fixes #805

Causes templates to throw when lookup fields are not defined within the context. Strict mode will throw when any field is omitted. assumeObjects mode maintains the existing behavior of outputting an empty response when fields are not defined but allows for performance/size optimizations by not doing safety checks for intermediate objects in the lookup chain.

Strict mode effectively disables the helperMissing and inverse handling for blockHelperMissing as templates will throw rather than call those features for missing data fields.

Fixes #651
Fixes #805
@kpdecker kpdecker added this to the 3.0 milestone Dec 27, 2014
kpdecker added a commit that referenced this pull request Jan 1, 2015
Implement strict and assumeObject modes
@kpdecker kpdecker merged commit 96a5cf5 into master Jan 1, 2015
@kpdecker kpdecker deleted the strict branch January 1, 2015 01:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Request: "strict" lookups There should be a configuration option to throw if a tag finds no match in the source

1 participant