summaryrefslogtreecommitdiffstats
path: root/lib/handlebars/compiler
Commit message (Collapse)AuthorAgeFilesLines
...
* Use ID lookup for ambiguous helper evaluationkpdecker2014-07-072-1/+4
| | | Final change for #731
* Rework lookup null protector logickpdecker2014-07-062-64/+67
| | | | | | | - Move the lookup null protection out of `nameLookup` and into that contexts that are aware of the needs for falsy vs. not displayed values. - Optimize lookup for nested path operations Fixes #731
* Move lambda resolution to runtimekpdecker2014-07-061-4/+2
| | | This has a very positive impact on precompiled output size, particularly for known-helpers cases, and little or no impact on the throughput numbers.
* Remove disassemble log statementkpdecker2014-06-281-3/+1
| | | Fixes #772
* Expose setup wrappers for compiled templateskpdecker2014-05-191-2/+8
|
* Merge pull request #797 from tomdale/full-helper-namesKevin Decker2014-05-191-1/+1
|\ | | | | Pass full helper ID to helperMissing when options are provided
| * Pass full id to helperMissingTom Dale2014-05-131-1/+1
| |
* | Ensure isHelper is coerced to a booleanMartin Muñoz2014-05-051-1/+1
|/
* Fix evaluation of paths and subexprskpdecker2014-03-052-8/+9
| | | Fixes #743
* Merge pull request #749 from jenseng/option_subexpressions_fixKevin Decker2014-03-052-10/+9
|\ | | | | properly handle multiple subexpressions in the same hash, fixes #748
| * properly handle multiple subexpressions in the same hash, fixes #748Jon Jensen2014-02-202-10/+9
| | | | | | | | | | push all hash params before popping any so as to avoid the last stackN var stomping previous ones
* | fix bug in IE<=8 (no Array::map), closes #751Jon Jensen2014-03-041-9/+11
|/ | | | | | | looks like this broke in 2812fe27 also s/this.i/var i/, since the functions that needed it were removed in a1edab6ef
* Add child accessor APIkpdecker2014-02-091-1/+8
|
* Add support for depthed resolution of data fieldskpdecker2014-02-092-7/+7
|
* Implement lookup helperkpdecker2014-02-091-1/+2
|
* Make raw blocks operate like blockskpdecker2014-02-091-3/+8
|
* raw block helpersJesse Ezell2014-02-091-0/+9
|
* Optimize buffer generate first and all edge caseskpdecker2014-02-091-26/+39
|
* Merge pull request #729 from wycats/precompile-literalKevin Decker2014-02-081-57/+55
|\ | | | | Convert template spec to object literal
| * Convert template spec to object literalkpdecker2014-02-061-57/+55
| | | | | | This allows for metadata to be associated with the template and a simplification of the template init logic.
* | Remove unnecessary conditionalkpdecker2014-02-061-3/+1
|/
* Add trackIds compiler flagkpdecker2014-01-173-4/+45
| | | | Allows helpers that care about where a particular field came from derive this data while maintaining backward compatibility with existing helpers.
* Fix missing parameters for pathed mustacheskpdecker2014-01-173-7/+9
| | | Fixes #658
* Allow decimal number valueskpdecker2014-01-173-8/+8
| | | Fixes #472
* Implement partial hash evaluationkpdecker2014-01-172-3/+9
|
* Add partial hash parser supportkpdecker2014-01-172-2/+8
|
* Improve usefulness of extend util, properly use namespace property, update ↵Blake Embrey2014-01-161-17/+28
| | | | setup options to use a hash helper.
* Merge pull request #634 from wycats/name-optionKevin Decker2014-01-152-19/+14
|\ | | | | It would be great to have the helper name passed to `blockHelperMissing`
| * Cleanup now unused code in jscompilerkpdecker2014-01-061-5/+4
| |
| * Include name option for all helper callskpdecker2014-01-062-16/+12
| | | | | | | | | | | | | | | | All helper calls will have access to `options.name` which is the first id value of the mustache operation. As part of this the helperMissing call has been simplified to remove the indexed name in order to optimize the call. This is a breaking change. Fixes #634
* | Expose the initial context via @rootkpdecker2014-01-151-1/+1
|/
* Refactor out pushParams methodkpdecker2014-01-061-34/+19
| | | Simplifies hash and param push logic
* Track stringParams mode in local state varskpdecker2014-01-062-8/+10
|
* Fix DATA value in stringParams modekpdecker2014-01-061-0/+1
| | | | Fixes #699
* Remove redundant conditions.Blake Embrey2014-01-051-4/+1
|
* Simplify ambiguous codekpdecker2014-01-042-9/+10
| | | | Remove if conditional in favor of boolean failover.
* Merge branch 'compiler-options' of github.com:blakeembrey/handlebars.js into ↵kpdecker2014-01-011-4/+9
|\ | | | | | | | | | | | | blakeembrey-compiler-options Conflicts: lib/handlebars/compiler/javascript-compiler.js
| * Pull options out from param setup to allow easier extension.Blake Embrey2013-12-281-5/+10
| |
* | Include line info in compiler thrown exceptionskpdecker2014-01-012-10/+14
| | | | | | Fixes #636
* | Remove duplication from generated subexpressionskpdecker2014-01-013-13/+41
| |
* | Whitespace cleanupkpdecker2013-12-311-4/+4
| |
* | Use literal for data lookupkpdecker2013-12-311-1/+1
| |
* | Add stack handling sanity checkskpdecker2013-12-311-0/+8
| |
* | Fix stack id "leak" on replaceStackkpdecker2013-12-311-1/+6
| |
* | Fix incorrect stack pop when replacing literalskpdecker2013-12-311-2/+4
| |
* | Fix multiple hash handling in subexpressionskpdecker2013-12-311-1/+5
| |
* | Add location tracking to sexprkpdecker2013-12-311-1/+3
| |
* | Added support for subexpressionsmachty2013-12-304-73/+95
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Handlebars now supports subexpressions. {{foo (bar 3)}} Subexpressions are always evaluated as helpers; if `3` were omitted from the above example, `bar` would be invoked as a param-less helper, even though a top-levell `{{bar}}` would be considered ambiguous. The return value of a subexpression helper is passed in as a parameter of a parent subexpression helper, even in string params mode. Their type, as listed in `options.types` or `options.hashTypes` in string params mode, is "sexpr". The main conceptual change in the Handlebars code is that there is a new AST.SexprNode that manages the params/hash passed into a mustache, as well as the logic that governs whether that mustache is a helper invocation, property lookup, etc. MustacheNode, which used to manage this stuff, still exists, but only manages things like white-space stripping and whether the mustache is escaped or not. So, a MustacheNode _has_ a SexprNode. The introduction of subexpressions is fully backwards compatible, but a few things needed to change about the compiled output of a template in order to support subexpressions. The main one is that the options hash is no longer stashed in a local `options` var before being passed to either the helper being invoked or the `helperMissing` fallback. Rather, the options object is inlined in these cases. This does mean compiled template sizes will be a little bit larger, even those that don't make use of subexpressions, but shouldn't have any noticeable impact on performance when actually rendering templates as only one of these inlined objects will actually get evaluated.
* | Merge pull request #694 from blakeembrey/compile-envKevin Decker2013-12-291-12/+9
|\ \ | | | | | | Make the environment reusable
| * | Make the environment reusable.Blake Embrey2013-12-281-12/+9
| |/
* | Fix ProgramNode parameter handling under IEkpdecker2013-12-291-3/+5
|/
* add line numbers to nodes when parsingStanley Stuart2013-12-281-15/+55
| | | | closes #691
* Merge pull request #684 from blakeembrey/javascript-variableKevin Decker2013-12-251-1/+1
|\ | | | | Allow any number of trailing characters for valid JavaScript variable
| * Allow any number of trailing characters.Blake Embrey2013-12-241-1/+1
| |
* | Remove unused varkpdecker2013-12-231-1/+0
| |
* | Expose compilerInfo and checkRevision as APIskpdecker2013-12-231-3/+7
| | | | | | Fixes #656
* | Fix handling of boolean escape in MustacheNodekpdecker2013-12-231-3/+8
| | | | | | Fixes issue with Ember compatibility due to direct instantiation of MustacheNode.
* | Use charAt rather than string indexkpdecker2013-12-231-1/+2
| | | | | | | | | | Older versions of IE do not support [] access to string contents so charAt must be used. Fixes #677
* | Export AST as an object rather than modulekpdecker2013-12-013-138/+144
| | | | | | The parser expects the AST object to be mutable, which modules are not.
* | Protect context-lookups from undefined valueskpdecker2013-11-031-3/+15
| | | | | | | | Fixes #166 Fixes #587
* | Implement strip opcodekpdecker2013-10-141-0/+19
| |
* | Defer content outputkpdecker2013-10-141-2/+19
| | | | | | | | Allows for stripping of the content after the fact.
* | Load strip flags from lex streamkpdecker2013-10-141-8/+26
| |
* | Wrap AST nodes in strip opcodes if definedkpdecker2013-10-141-2/+14
| |
* | Use accept for all compiler traversalkpdecker2013-10-141-4/+3
| |
* | Kill unused functionskpdecker2013-10-141-9/+0
| |
* | Push Source helper methodkpdecker2013-10-141-11/+15
| |
* | Pass open token to MustacheNode for flag parsingkpdecker2013-10-141-2/+3
| |
* | Fix argument not found errorkpdecker2013-10-141-1/+1
| |
* | Pass options hash to context function execkpdecker2013-10-141-1/+1
| | | | | | Fixes #599
* | Fix transpiler error in printer.jskpdecker2013-10-121-1/+4
| |
* | Remove global Handlebars referenceskpdecker2013-10-091-1/+1
| |
* | Use template env and compile methodskpdecker2013-10-091-3/+2
| |
* | Expose current Handlebars namespace fieldskpdecker2013-10-011-1/+1
| |
* | Use proper default vs. module import semanticskpdecker2013-10-015-40/+37
| |
* | Break exception class out into a standalone modulekpdecker2013-10-012-2/+2
| |
* | Fix global Handlebars referenceskpdecker2013-10-011-4/+4
| |
* | Update logger for es6 moduleskpdecker2013-09-301-13/+4
| |
* | Merge commit '87b5d4ee61605b026506e92c9e8873d867c5f150' into es6-moduleskpdecker2013-09-021-3/+3
|\ \ | |/ | | | | | | | | | | | | Conflicts: dist/handlebars.js dist/handlebars.runtime.js lib/handlebars/base.js lib/handlebars/utils.js
| * Remove unused varkpdecker2013-07-301-3/+3
| |
* | Make the Handlebars environment into an objectYehuda Katz2013-07-261-3/+3
| | | | | | | | | | | | | | | | The idea is that the environment wraps up the mutable stuff in Handlebars (like the helpers) and that you could theoretically create a new one at any time and pass it in to Handlebars.template. Every test makes a new environment and uses it in template compilation.
* | Further progress towards modularization.Yehuda Katz2013-07-245-29/+44
| | | | | | | | | | At this point, I have only 2 fails in the Node build, but I'm doing a bunch of manual stuff locally and still have a bunch of hacks.
* | Building an AMD fileYehuda Katz2013-07-164-6/+4
| |
* | More modularizationYehuda Katz2013-07-023-54/+21
| |
* | Initial work on ES6 modulesYehuda Katz2013-07-014-84/+50
|/
* Break JavascriptCompiler into standalone filekpdecker2013-06-033-845/+861
|
* Remove unnecessary functionkpdecker2013-06-021-6/+3
|
* Merge global and passed helpers and partialskpdecker2013-05-311-2/+3
|
* Allow execution of helpers on the contextkpdecker2013-05-301-1/+2
| | | Fixes #285
* Allow ID, STRING, or INTEGER for partial namekpdecker2013-05-291-1/+1
| | | Fixes #519
* Protect from object prototype modificationskpdecker2013-05-281-1/+3
| | | | Fixes #534
* Improve tracking of original path valueskpdecker2013-05-271-7/+12
|
* Add support for complex ids in @data referenceskpdecker2013-05-272-3/+11
|
* Merge pull request #454 from leshill/fix_string_mode_contextsKevin Decker2013-04-071-2/+13
|\ | | | | Add contexts for string mode hash values
| * Add contexts for string mode hash valuesLes Hill2013-03-191-2/+13
| | | | | | | | Allows for evaluating hash parameters such as ../city in string mode.
* | Merge branch 'program-metadata'kpdecker2013-04-071-6/+1
|\ \
| * | Add program metadatakpdecker2013-02-171-6/+1
| |/ | | | | | | | | | | Include program id and depth on the generated wrapper objects. This allows helpers who are passed these objects to differentiate between helpers for cases where they may want to cache the generated DOM structure.
* | Restore knownHelpersOnly throwkpdecker2013-04-061-1/+1
| | | | | | Fixes #302
* | Allow compilation of empty stringkpdecker2013-04-061-2/+2
| | | | | | Fixes #461
* | Escape unicode newlines in string literalskpdecker2013-04-061-1/+3
|/ | | Fixes #375