summaryrefslogtreecommitdiffstats
path: root/lib
Commit message (Collapse)AuthorAgeFilesLines
* Walk up data frames for nested @partial-blockLon Ingram2016-08-161-1/+6
| | | | | | | | | | | | | | The root cause of #1218 is that `invokePartial` creates a stack of data frames for nested partial blocks, but `resolvePartial` always uses the value at top of the stack without "popping" it. The result is an infinite recursive loop, as references to `@partial-block` in the partial at the top of the stack resolve to itself. So, walk up the stack of data frames when evaluating. This is accomplished by 1) setting the `partial-block` property to `noop` after use and 2) using `_parent['partial-block']` if `partial-block` is `noop` Fix #1218
* Use objects for hash value trackingkpdecker2016-03-111-1/+1
| | | | | | The use of arrays was incorrect for the data type and causing problems when hash keys conflicted with array behaviors. Fixes #1194
* Ensure that existing blockParams and depths are respected on dupe programsCharles O'Farrell2016-03-081-8/+10
| | | | Fixes #1186
* Throw exception if id tracking args are passedkpdecker2015-12-261-26/+26
| | | Fixes #1151
* Drop extra Error paramskpdecker2015-12-141-1/+1
| | | This was causing a difficult to diagnose failure under IE and doesn’t give us enough value to justify the change.
* Exclude coverage check in exception conditionalkpdecker2015-12-121-0/+1
|
* Fix throw when creating exception object in Safarikpdecker2015-12-121-4/+14
| | | https://github.com/jquery/esprima/issues/1290
* Relax depth check for context pushkpdecker2015-12-121-2/+2
| | | | Fixes #1135
* Remove semi-documented _setup and _child APIskpdecker2015-12-122-27/+4
| | | These were a bad idea to begin with and without the trackIds implementation they don’t make much sense.
* Remove stringParams and trackIds modemachty2015-12-107-193/+8
| | | | Closes #1145
* v4.0.5v4.0.5kpdecker2015-11-191-1/+1
|
* Return current handlebars instance from noConflictkpdecker2015-11-191-0/+1
| | | Fixes wycats/handlebars-site#131
* Fix lint errors under latest eslintkpdecker2015-10-312-2/+2
|
* v4.0.4v4.0.4kpdecker2015-10-291-1/+1
|
* Use template string :sparkles: for error message and double-quotes for ↵Mark Christian2015-10-191-1/+1
| | | | quoting partial name
* Include partial name in 'undefined partial' exception messageMark Christian2015-10-191-1/+1
|
* v4.0.3v4.0.3kpdecker2015-09-231-1/+1
|
* Create data frame for @partial-blockkpdecker2015-09-231-0/+1
| | | Fixes #1099
* Fix tests under IEkpdecker2015-09-231-1/+3
|
* Fix iteration over undefined valueskpdecker2015-09-232-9/+6
| | | | | Allow for iteration on undefined values, but special case undefined and null to prevent rendering errors when not running in strict mode. Fixes #1093
* v4.0.2v4.0.2kpdecker2015-09-041-1/+1
|
* Fix use of decorators within partialskpdecker2015-09-041-1/+1
| | | | | If a decorator is used within a partial but not in the calling template, the hash is not passed in. For now error on the side of always including as just assigning values has minimal overhead. Fixes #1089
* v4.0.1v4.0.1kpdecker2015-09-021-1/+1
|
* Fix failure when using decorators in partialskpdecker2015-09-021-0/+1
|
* Update to latest eslintkpdecker2015-09-016-9/+9
|
* v4.0.0v4.0.0kpdecker2015-09-011-1/+1
|
* Escape = in HTML contentkpdecker2015-09-011-3/+4
| | | | | There was a potential XSS exploit when using unquoted attributes that this should help reduce. Fixes #1083
* Rev runtime compiler revisionkpdecker2015-09-011-2/+3
|
* Add explicitPartialContext compiler flagkpdecker2015-09-011-1/+5
| | | Fixes #1032
* Merge branch 'decorators'kpdecker2015-09-0111-11/+176
|\
| * Implement decorator helper methodkpdecker2015-08-221-12/+13
| |
| * Implement inline partialskpdecker2015-08-223-0/+27
| | | | | | | | | | | | Allows for partials to be defined within the current template to allow for localized code reuse as well as for conditional behavior within nested partials. Fixes #1018
| * Implement block decoratorskpdecker2015-08-224-6/+104
| | | | | | | | These allow for a given block to be wrapped in helper methods or metadata and allow for more control over the current container and method before the code is run.
| * Add decorator parsingkpdecker2015-08-224-4/+19
| |
| * Implement decorator environment and registrationkpdecker2015-08-223-1/+25
| |
* | Fix #each when last object entry has empty keyDennis Kuczynski2015-08-301-1/+1
|/
* Add whitespace control to partial block statementskpdecker2015-08-221-1/+3
|
* Create validateClose helper methodkpdecker2015-08-221-20/+19
| | | | Avoid duplicating the logic needed to check for close block mismatches.
* Implement partial blockskpdecker2015-08-225-24/+85
| | | | | | This allows for failover for missing partials as well as limited templating ability through the `{{> @partial-block }}` partial special case. Partial fix for #1018
* Improve sanity checks in compiler and visitorkpdecker2015-08-222-2/+13
|
* Drop AST constructors in favor of JSONkpdecker2015-08-185-148/+65
| | | | | These were little more than object literal statements that were less clear due to their use of index-based arguments. Fixes #1077
* Pass container rather than exec as contextkpdecker2015-08-182-12/+12
| | | There is no real need for us to do `.call(container` other than for backwards compatibility with legacy versions. Using the 4.x release as a chance to optimize this behavior.
* Remove unused parameterskpdecker2015-08-181-2/+2
|
* Add ignoreStandalone compiler optionkpdecker2015-08-132-6/+10
| | | Fixes #1072
* Ignore empty when iterating on sparse arrayskpdecker2015-08-041-0/+6
| | | Fixes #1065
* Add support for string and stdin precompilationkpdecker2015-08-041-4/+72
| | | Fixes #1071
* Simplify object assignment generation logickpdecker2015-08-041-14/+9
|
* Convert precompiler template loading to asynckpdecker2015-08-041-41/+64
|
* Refactor precompiler API into two phasekpdecker2015-08-041-71/+83
| | | Load templates and then parse them in a distinct operation. This will allow us to use other input sources such as stdin and strings.
* Bulletproof AST.helpers.helperExpressionkpdecker2015-08-031-1/+3
| | | | | Avoid undefined values and potential false positives from other type values such as partials. Fixes #1055
* Use += in printerkpdecker2015-08-031-9/+9
|
* Enforce 100% code coveragekpdecker2015-08-032-14/+16
|
* Fix partial handling with different contextkpdecker2015-08-031-1/+1
|
* Always return string responseskpdecker2015-08-031-1/+1
| | | | | Certain optimizations for simple templates could result in objects returned by helpers returned rather than their string representation, resulting in some odd edge cases. This ensures that strings are always returned from the API for consistency. Fixes #1054.
* Pass undefined fields to helpers in strict modekpdecker2015-08-032-9/+13
| | | | | This allows for `{{helper foo}}` to still operate under strict mode when `foo` is not defined on the context. This allows helpers to perform whatever existence checks they please so patterns like `{{#if foo}}{{foo}}{{/if}}` can be used to protect against missing values. Fixes #1063
* Avoid depth creation when context remains the samekpdecker2015-08-031-2/+11
| | | | | | | Creating a new depth value seems to confuse users as they don’t expect things like `if` to require multiple `..` to break out of. With the change, we avoid pushing a context to the depth list if it’s already on the top of the stack, effectively removing cases where `.` and `..` are the same object and multiple `..` references are required. This is a breaking change and all templates that utilize `..` will have to check their usage and confirm that this does not break desired behavior. Helper authors now need to take care to return the same context value whenever it is conceptually the same and to avoid behaviors that may execute children under the current context in some situations and under different contexts under other situations. Fixes #1028
* Fix track id handling in partialskpdecker2015-08-031-0/+6
| | | Fixes #914
* Handle this references properly in track id modekpdecker2015-08-031-2/+3
|
* Remove out of date TODOkpdecker2015-08-031-2/+0
|
* Improve logging APIkpdecker2015-08-032-13/+39
| | | | | | | Adds multiple variable support and the ability to set statement level logging semantics. This breaks that logger API, cleaning up the manner in which enums are set, but the other behaviors are backwards compatible. Fixes #956
* Move logger into separate modulekpdecker2015-08-012-21/+23
|
* Increase code coveragekpdecker2015-08-013-4/+6
|
* Move helpers into separate moduleskpdecker2015-08-0110-173/+206
|
* Fix with operator in no @data modekpdecker2015-08-011-1/+1
|
* Allow empty key name in each iterationkpdecker2015-08-011-1/+1
| | | Fixes #1021
* Add with block parameter supportkpdecker2015-08-011-3/+6
| | | | Fixes #1042
* Fix escaping of non-javascript identifierskpdecker2015-08-011-1/+1
| | | | The ‘ character would cause invalid javascript to be generated as it was not properly escaped. Switching to JSON.stringify safely handles all potential unescaped cases.
* Fix typoSaleh Batati2015-07-301-1/+1
|
* #1056 Fixed grammar for nested raw blocksEric Nielsen2015-07-151-2/+2
|
* Fix location information for programskpdecker2015-06-261-0/+25
| | | | | | | | There appears to be a bug in our use of jison causing the parent location information to be reported to programs. I wasn’t able to work through what might be causing this so instead using the location information of the statements collection to generate the proper location information. This is a bit of a hack but we are very far behind on the Jison release train and upgrading will likely be a less than pleasant task that doesn’t provide us much benefit. Fixes #1024
* Move noConflict implementation to modulekpdecker2015-04-273-25/+25
| | | | | | DRYs the code to avoid escapes like #1004 Fixes #1004
* Remove jshint completelykpdecker2015-04-275-9/+0
|
* Update for let and optional parameterskpdecker2015-04-2015-239/+236
|
* Run the precompiler module through es6 toolchainkpdecker2015-04-201-18/+16
|
* Enable additional es6 features in eslintkpdecker2015-04-201-0/+1
|
* Add full support for es6kpdecker2015-04-1617-227/+236
| | | | | | | | Converts the tool chain to use babel, eslint, and webpack vs. the previous proprietary solutions. Additionally begins enforcing additional linting concerns as well as updates the code to reflect these rules. Fixes #855 Fixes #993
* Use captureStackTrace for error handlerkpdecker2015-04-141-0/+4
| | | Provides more stable error stack reporting when running under v8 environments.
* Allow this references in literal statementskpdecker2015-04-141-2/+13
| | | Fixes #967
* Expose Visitor in full browser buildkpdecker2015-04-132-2/+3
| | | Fixes #994
* Ignore branches tested without coverage monitoringkpdecker2015-04-071-1/+2
|
* Remove vestigial codekpdecker2015-04-071-5/+0
|
* Add undefined and null literal supportkpdecker2015-04-074-0/+30
| | | | | This adds the UndefinedLiteral and NullLiteral to AST. Fixes #990
* Avoid source-map import under AMDkpdecker2015-04-071-2/+12
| | | Fixes #989
* v3.0.1v3.0.1kpdecker2015-03-241-1/+1
|
* Optimize hot path in escapeExpressionkpdecker2015-03-161-13/+15
| | | | | Avoid deoptimizations in v8 due to the duct type check on string instances. Partial fix for #973
* Fix typokpdecker2015-02-101-1/+1
|
* v3.0.0v3.0.0kpdecker2015-02-101-1/+1
|
* Handle all potential literal valueskpdecker2015-02-091-5/+9
| | | Adds support for literal helper names in a few missing cases such as block expressions and subexpressions.
* Transform literals to path expressions in mustache nodesMarcio Junior2015-02-081-5/+9
|
* Test compilation of literal values in mustachesMarcio Junior2015-02-081-1/+5
|
* Fail over to console.log if lacking console methodkpdecker2015-02-071-4/+2
| | | This improves logger resiliency under older browsers.
* Change default log level to infokpdecker2015-02-071-1/+1
| | | | | | Eventually we want to fix this API so that you can provide per-instance levels, etc but for now this is a quick fix. Fixes wycats/handlebars-site#91
* Avoid direct references to sexpr in statementskpdecker2015-01-185-58/+58
| | | | | This allows us to avoid creating unnecessary AST nodes and avoids things like isHelper. Side effect of these changes is that @data functions can now have data parameters passed to them.
* Add support for dynamic partial nameskpdecker2015-01-186-8/+46
| | | | | | | | | Uses the subexpression syntax to allow for dynamic partial lookups. Ex: ``` {{> (helper) }} ``` Fixes #933
* Add missing reserved words so compiler knows to use array syntax:Matthew Flaschen2015-01-171-1/+2
| | | | | | | | | | | | | | | | * await * null * true * false IE 8 was failing to compile Handlebars-generated source code because it had helpers.null. I came up with this list by diffing https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Lexical_grammar#Keywords against the ones Handlebars already had. I added two corresponding tests for nameLookup.
* Merge pull request #932 from wycats/strictKevin Decker2014-12-312-7/+48
|\ | | | | Implement strict and assumeObject modes
| * Implement strict and assumeObject modeskpdecker2014-12-272-7/+48
| | | | | | | | | | | | | | | | 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
* | Merge branch 'master' into visitor-updatekpdecker2014-12-273-4/+14
|\ \ | |/
| * Fix block param evaluation under older IEkpdecker2014-12-272-2/+12
| |
| * Strip unnecessary whitespace in template outputkpdecker2014-12-271-1/+1
| |