summaryrefslogtreecommitdiffstats
path: root/lib
Commit message (Collapse)AuthorAgeFilesLines
* 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
| |
| * Fix duplicate return statement on simple templateskpdecker2014-12-271-1/+1
| |
* | Fix case-insensitive file system compile issuekpdecker2014-12-261-1/+1
| |
* | Add parent tracking and mutation to AST visitorskpdecker2014-12-261-35/+78
|/ | | Fixes #916
* Bump code coveragekpdecker2014-12-264-2/+7
|
* Implement block parameterskpdecker2014-12-265-51/+135
| | | Fixes #907
* Expose AST helpers in public APIkpdecker2014-12-212-21/+26
|
* Update fix for #926 for 3.0 codelinekpdecker2014-12-171-1/+1
|
* Track depths on deduped childrenkpdecker2014-12-161-0/+2
| | | | | 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
* Avoid unnecessary this. referencekpdecker2014-12-161-3/+3
|
* Fix remaining depth argkpdecker2014-12-161-1/+0
|
* Remove unused vars and add jshint checkingkpdecker2014-12-167-10/+3
|
* Remove Compiler.depths parameterkpdecker2014-12-162-19/+7
| | | | This is no longer necessary with the depths array tracking and adds compiler overhead.
* Add instructions for 'spec/mustache' to CONTRIBUTING.md, fix a few typos ↵Or Neeman2014-12-073-3/+3
| | | | elsewere
* Add basic docs for JavaScriptCompiler override APIkpdecker2014-11-291-9/+9
|
* Drop unused JavaScriptCompiler.namespace paramkpdecker2014-11-291-2/+0
|
* Move compileProgram out of visitor methodskpdecker2014-11-291-18/+18
|
* Track source node via accept call rather vs opcodekpdecker2014-11-291-41/+46
|
* s/Subexpression/SubExpression/kpdecker2014-11-291-1/+1
|
* Rework strip flags to make clearer at in AST levelkpdecker2014-11-284-188/+239
| | | Rather than keeping state in the AST, which requires some gymnastics, we create a separate visitor flow which does the top down iteration necessary to calculate all of the state needed for proper whitespace control evaluation.
* Move Jison parsing out of AST into helperskpdecker2014-11-282-38/+46
|
* Add original to BooleanLiteralkpdecker2014-11-281-1/+2
|
* Rename AST objects to match type nameskpdecker2014-11-282-16/+16
|
* Treat partial exec in a manner closer to helperskpdecker2014-11-274-48/+50
| | | This helps unify the code handling and will also be needed to support string/id tracking on partials.
* Update subexpression and hash AST constructskpdecker2014-11-276-105/+104
|
* Simplify Path and Sexpr calculated flagskpdecker2014-11-272-25/+38
|
* Replace DataNode and IdNode with PathNodekpdecker2014-11-265-55/+42
| | | This is a breaking change for string mode users as there is no longer a distinct type for data parameters. Instead data consumers should look for the @ prefix value.
* Update literal ast nodes for new speckpdecker2014-11-265-26/+23
|
* Update statement node ASTskpdecker2014-11-265-147/+133
|
* Update MustacheNode for new AST structurekpdecker2014-11-264-25/+14
|
* Update ProgramNode to better match SpiderMonkeykpdecker2014-11-266-61/+62
|
* Update AST location info to match SpiderMonkeykpdecker2014-11-267-50/+52
| | | Part of #889
* Make each helper data uniformkpdecker2014-11-261-19/+26
| | | | | Provide @key and @last value for all forms of iteration. Fixes #910
* Provide Handlebars.noConflict implementationkpdecker2014-11-262-0/+18
| | | | | Allows for users who are loading via a global pattern to avoid conflicting with other instances of the library. Fixes #887
* Lookup partials when undefinedkpdecker2014-11-251-0/+3
|
* Optimize variable declarationkpdecker2014-11-251-2/+1
|
* Add parser support for block paramsMartin Muñoz2014-11-113-2/+14
|
* Propagate options for client compiled partialskpdecker2014-11-082-1/+3
| | | Fixes #901
* Merge branch 'remove-block-mustache' of github.com:mmun/handlebars.js into ↵kpdecker2014-11-084-26/+31
|\ | | | | | | | | | | | | | | mmun-remove-block-mustache Conflicts: lib/handlebars/compiler/helpers.js spec/parser.js
| * Remove RawBlockNode in favor of prepareRawBlock helperMartin Muñoz2014-11-052-9/+3
| |
| * Simplify BlockNode by removing intermediate MustacheNodeMartin Muñoz2014-11-024-20/+31
| |
* | Only provide aliases for multiple use callskpdecker2014-11-081-26/+39
| | | | | | Fixes #903
* | Provide default mapping for boilerplate codekpdecker2014-11-081-1/+5
| |
* | Add source map output support to the CLIkpdecker2014-11-081-20/+57
| |
* | Generate source mapskpdecker2014-11-082-100/+275
| | | | | | | | | | | | Allow the precompiler to generate source maps when the srcFile parameter is passed. This refactors large chunks of the code generation pipeline, allowing metadata to be associated with code chunks as well as breaking out much of the code generation logic into a separate helper.
* | Include location information in all opcodeskpdecker2014-11-082-45/+50
| |
* | Merge pull request #892 from wycats/else-ifKevin Decker2014-11-081-7/+26
|\ \ | | | | | | Implement parser for else chaining of helpers
| * | Implement parser for else chaining of helperskpdecker2014-10-271-7/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Allows users to chain multiple helpers together using their inverse callbacks. I.e. ``` {{#if foo}} {{else if bar}} {{else}} {{/if}} ``` The control flow here effectively causes the helpers to be nested. The above is actually syntactic sugar for this: ``` {{#if foo}} {{else}} {{#if bar}} {{else}} {{/if}} {{/if}} ``` Any helper may be used in this manner, the only requirement is they support normal calls and inverse calls. Introduces a breaking change in that `{{else foo}}` may no longer be used as a root level operator. Instead `{{^foo}}` must be used. Fixes #72.
* | | Use toHTML vs. instanceof checks for SafeStringkpdecker2014-11-082-3/+3
| | | | | | | | | | | | | | | | | | Allows for us to play nicely in environments such as Node that could have multiple versions of the library loaded. Also allows for implementors to provide their own behavior, provided they know what they are doing. Fixes #886
* | | Merge pull request #870 from max-b/masterKevin Decker2014-11-081-0/+3
|\ \ \ | | | | | | | | Registering undefined partial throws exception.
| * | | Registering undefined partial throws exception.Maxb2014-09-191-0/+3
| |/ /
* | | Simplify program generation logickpdecker2014-11-081-10/+2
| | |
* | | Bump test coveragekpdecker2014-11-082-3/+4
| | |
* | | Ignore unused code pathskpdecker2014-11-081-0/+2
| | | | | | | | | | | | We don’t want to remove these as the generic code may need it in the future, but these code paths are not triggered through the existing language constructs.
* | | Merge setupParams and setupOptionskpdecker2014-11-061-9/+2
| | |
* | | Simplify flushInline implementationkpdecker2014-11-051-19/+10
| | |
* | | Use terinary operator for inline appendskpdecker2014-11-051-7/+12
| | | | | | | | | | | | Allows for append operations to avoid breaking inline chain.
* | | Provide stubbed visitor implementationkpdecker2014-11-051-2/+58
| |/ |/| | | Part of #889
* | Add preventIndent option for partialskpdecker2014-11-021-1/+6
| | | | | | | | | | This disables the standalone partial indent behavior required by the Mustache spec and allows for users to utilize partials in the same manner as under 1.x. Fixes #858
* | Allow whitespace control on commentskpdecker2014-11-022-4/+8
| | | | | | | | | | This changes the call signature for the CommentNode constructor, which is a potentially breaking change for AST users. Fixes #866
* | Capitalization change in comments for consistencyAlex Jeng2014-09-231-1/+1
|/
* v2.0.0v2.0.0kpdecker2014-09-011-1/+1
|
* Cleanup var names slightlykpdecker2014-08-271-6/+6
|
* v2.0.0-beta.1v2.0.0-beta.1kpdecker2014-08-261-1/+1
|
* Render false literal as “false”kpdecker2014-08-252-2/+4
| | | Fixes #827
* Prune unused codekpdecker2014-08-255-8/+4
|
* Expose default compatibility wrapper for umd buildkpdecker2014-08-252-0/+4
|
* Add template isTop flagkpdecker2014-08-251-0/+1
|
* Fix compiler version tagkpdecker2014-08-251-1/+1
|
* Rev runtime versionkpdecker2014-08-251-2/+3
|
* Refactor content blocks to ignore lineskpdecker2014-08-251-57/+31
| | | | | We can simplify our previous standalone determination logic by merging content blocks again. Fixes #854
* Expose escapeExpression on the root objectkpdecker2014-08-251-0/+1
|
* Allow passing depths to _childkpdecker2014-08-252-6/+6
|