summaryrefslogtreecommitdiffstats
path: root/spec
Commit message (Collapse)AuthorAgeFilesLines
* Use XML-like tags in test instead of bizarre dot delimitersLon Ingram2016-08-171-4/+4
|
* Add test reproducing #1185Lon Ingram2016-08-171-0/+9
|
* Walk up data frames for nested @partial-blockLon Ingram2016-08-161-0/+14
| | | | | | | | | | | | | | 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-0/+11
| | | | | | 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-0/+9
| | | | Fixes #1186
* Throw exception if id tracking args are passedkpdecker2015-12-261-2/+11
| | | Fixes #1151
* Remove amd files from the buildkpdecker2015-12-142-230/+0
| | | | | Users can utilize the UMD library if they are still using require.js and if they need to have specific modules, they can consume the cjs or es6 modules via webpack or similar. Fix for #1096
* Merge branch 'master' of https://github.com/ryanmurakami/handlebars.jsRyan Lewis2015-12-138-500/+53
|\
| * Avoid error in older browsers in testkpdecker2015-12-121-9/+7
| | | | | | The tests are run through the transpiler and just reverting the user of template literal is easier than adding transpiler to the test stack.
| * Relax depth check for context pushkpdecker2015-12-121-0/+23
| | | | | | | | Fixes #1135
| * Remove semi-documented _setup and _child APIskpdecker2015-12-121-37/+0
| | | | | | 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-103-457/+0
| | | | | | | | Closes #1145
| * Include tests for minimized artifactskpdecker2015-11-193-6/+32
| |
* | Adding documentation for running testsRyan Lewis2015-12-131-0/+0
|/
* 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
|
* Create data frame for @partial-blockkpdecker2015-09-231-0/+8
| | | Fixes #1099
* Fix tests under IEkpdecker2015-09-233-6/+8
|
* Fix iteration over undefined valueskpdecker2015-09-231-0/+18
| | | | | Allow for iteration on undefined values, but special case undefined and null to prevent rendering errors when not running in strict mode. Fixes #1093
* Allow for escaped ] characters in [] IDskpdecker2015-09-162-0/+11
| | | | | | | | Allows for ] literal characters to be used within [] IDs by prefixing them with the \ character. `\` literal at the end of the may be referenced by the `\\` sequence if conflicting. Under most circumstances the `\\` sequence will continue to work. Potentially breaking change for users of [] ids that have `\\` anywhere in the id or `\` at the end of the id. Fixes #1092
* Fix use of decorators within partialskpdecker2015-09-041-0/+8
| | | | | 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
* Fix failure when using decorators in partialskpdecker2015-09-021-0/+9
|
* Better assert message in shouldThrowkpdecker2015-09-021-1/+1
|
* Update to latest eslintkpdecker2015-09-0110-22/+20
|
* Escape = in HTML contentkpdecker2015-09-011-0/+1
| | | | | There was a potential XSS exploit when using unquoted attributes that this should help reduce. Fixes #1083
* Rev runtime compiler revisionkpdecker2015-09-011-1/+1
|
* Add explicitPartialContext compiler flagkpdecker2015-09-011-0/+15
| | | Fixes #1032
* Merge branch 'decorators'kpdecker2015-09-016-3/+245
|\
| * Implement decorator helper methodkpdecker2015-08-221-3/+3
| |
| * Implement inline partialskpdecker2015-08-221-0/+39
| | | | | | | | | | | | 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-221-0/+138
| | | | | | | | 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-223-0/+25
| |
| * Implement decorator environment and registrationkpdecker2015-08-221-0/+40
| |
* | Fix #each when last object entry has empty keyDennis Kuczynski2015-08-301-0/+10
|/
* Implement partial blockskpdecker2015-08-224-2/+78
| | | | | | This allows for failover for missing partials as well as limited templating ability through the `{{> @partial-block }}` partial special case. Partial fix for #1018
* Drop AST constructors in favor of JSONkpdecker2015-08-184-137/+33
| | | | | 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-181-1/+1
| | | 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.
* Add object option to test runnerkpdecker2015-08-181-1/+4
|
* Run node tests lastkpdecker2015-08-181-2/+2
| | | This covers all of the test cases and generally have better stack traces so we want to have these featured more prominently.
* Cleanup stack traces for test assertionskpdecker2015-08-141-6/+22
|
* Add ignoreStandalone compiler optionkpdecker2015-08-131-0/+10
| | | Fixes #1072
* Ignore empty when iterating on sparse arrayskpdecker2015-08-041-0/+7
| | | Fixes #1065
* Add support for string and stdin precompilationkpdecker2015-08-041-0/+46
| | | Fixes #1071
* Simplify object assignment generation logickpdecker2015-08-041-0/+7
|
* Convert precompiler template loading to asynckpdecker2015-08-041-27/+37
|
* Refactor precompiler API into two phasekpdecker2015-08-041-40/+58
| | | Load templates and then parse them in a distinct operation. This will allow us to use other input sources such as stdin and strings.
* Include doctype in amd harnesskpdecker2015-08-031-0/+1
|
* Bulletproof AST.helpers.helperExpressionkpdecker2015-08-031-14/+52
| | | | | Avoid undefined values and potential false positives from other type values such as partials. Fixes #1055
* Enforce 100% code coveragekpdecker2015-08-032-0/+18
|
* Fix partial handling with different contextkpdecker2015-08-031-0/+6
|
* Always return string responseskpdecker2015-08-031-0/+14
| | | | | 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-031-0/+17
| | | | | 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-032-1/+19
| | | | | | | 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/+44
| | | Fixes #914
* Handle this references properly in track id modekpdecker2015-08-031-2/+4
|
* Avoid log output in testkpdecker2015-08-031-1/+7
|
* Improve logging APIkpdecker2015-08-031-1/+61
| | | | | | | 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
* Fix with operator in no @data modekpdecker2015-08-011-0/+6
|
* Allow empty key name in each iterationkpdecker2015-08-011-0/+10
| | | Fixes #1021
* Add with block parameter supportkpdecker2015-08-011-0/+4
| | | | Fixes #1042
* Fix escaping of non-javascript identifierskpdecker2015-08-011-2/+6
| | | | 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.
* Added spec messageEric Nielsen2015-07-161-1/+1
|
* #1056 Added spec for nested raw blockEric Nielsen2015-07-151-0/+10
|
* Fix location information for programskpdecker2015-06-262-4/+47
| | | | | | | | 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
* Merge pull request #1019 from aymerick/aymerick-patch-typo-testKevin Decker2015-05-061-1/+1
|\ | | | | Fixes typo in tests
| * Fixes typo in testsAymerick2015-05-061-1/+1
| | | | | | mutache => mustache
* | Add tests for string contextskpdecker2015-05-062-0/+11
|/ | | | Fixes #1013
* Fix tokenizer test for double quoted stringsAymerick2015-05-011-1/+1
| | | | | There is two consecutive tests with the same input data: "{{ foo bar \'baz\' }}" I suppose the first test should be about testing double quoted string.
* Run the precompiler module through es6 toolchainkpdecker2015-04-201-1/+1
|
* Enable additional es6 features in eslintkpdecker2015-04-201-1/+3
|
* Add full support for es6kpdecker2015-04-1630-1276/+1299
| | | | | | | | 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
* Fix IE test freakoutkpdecker2015-04-141-2/+2
|
* Allow this references in literal statementskpdecker2015-04-141-4/+15
| | | Fixes #967
* Allow undefined and null in helper nameskpdecker2015-04-133-1/+19
|
* Add undefined and null literal supportkpdecker2015-04-075-2/+23
| | | | | This adds the UndefinedLiteral and NullLiteral to AST. Fixes #990
* Avoid source-map import under AMDkpdecker2015-04-071-2/+4
| | | Fixes #989
* Add require.js error reporting in testskpdecker2015-04-072-4/+35
| | | Adds test coverage for #989
* Handle all potential literal valueskpdecker2015-02-091-12/+23
| | | 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-7/+9
|
* Test compilation of literal values in mustachesMarcio Junior2015-02-081-0/+16
|
* Boolean literals can be passed to mustachesMarcio Junior2015-02-081-0/+4
|
* Fix console.log cleanupkpdecker2015-02-071-1/+4
|
* Fix global leak in testkpdecker2015-02-071-0/+1
|
* Fail over to console.log if lacking console methodkpdecker2015-02-071-1/+5
| | | This improves logger resiliency under older browsers.
* Change default log level to infokpdecker2015-02-071-4/+6
| | | | | | 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-183-13/+23
| | | | | 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-181-0/+26
| | | | | | | | | Uses the subexpression syntax to allow for dynamic partial lookups. Ex: ``` {{> (helper) }} ``` Fixes #933
* Add tests for partial comment whitespace controlkpdecker2015-01-171-3/+7
|
* Include error info when throwing type errorkpdecker2015-01-171-1/+1
|
* Add missing reserved words so compiler knows to use array syntax:Matthew Flaschen2015-01-171-0/+6
| | | | | | | | | | | | | | | | * 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-311-0/+124
|\ | | | | Implement strict and assumeObject modes
| * Implement strict and assumeObject modeskpdecker2014-12-271-0/+124
| | | | | | | | | | | | | | | | 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-271-3/+7
|\ \ | |/
| * Fix sourcemap testkpdecker2014-12-271-2/+2
| |
| * Safely handle source map in browser testskpdecker2014-12-271-5/+9
| |
* | Add parent tracking and mutation to AST visitorskpdecker2014-12-261-3/+108
|/ | | Fixes #916
* Bump code coveragekpdecker2014-12-262-7/+1
|
* Implement block parameterskpdecker2014-12-264-1/+113
| | | Fixes #907
* Track depths on deduped childrenkpdecker2014-12-161-1/+18
| | | | | Fixes a very specific error case where deduped children won’t receive the depths object due to it being omitted by the caller when optimizing. Fixes #926
* Add instructions for 'spec/mustache' to CONTRIBUTING.md, fix a few typos ↵Or Neeman2014-12-071-1/+1
| | | | elsewere