462 Commits

Author SHA1 Message Date
kpdecker 054627adb0 Move precompiler test filter into describe
This allows us to play nicely with in-browser tests
2014-07-05 15:03:18 -05:00
kpdecker 059532295d Move precompiler to safer location
Attempts to avoid some of the Node vs. ES6 confusion between the different styles within the application.

Also adds some simple tests in addition to the integration test.
2014-07-05 14:39:28 -05:00
kpdecker 7172d167dd Provide clear throw on {{#each}}
Fixes #773
2014-05-27 10:54:28 -04:00
kpdecker 3cdf14d294 Add test case for Issue #800
This isn’t failing in master but this is a useful test to prevent regressions.
2014-05-27 09:32:29 -04:00
Tom Dale 72c1262394 Pass full id to helperMissing 2014-05-13 13:24:25 +01:00
kpdecker b61c75512a Remove log in test 2014-03-05 21:11:47 -06:00
kpdecker 55782f08c5 Fix evaluation of paths and subexprs
Fixes #743
2014-03-05 17:49:39 -06:00
kpdecker 058c0fb6ba Make JSON a requirement for the compiler.
Include the polyfill for testing under IE8 and below and document this.
2014-03-05 17:15:23 -06:00
kpdecker 10168cb0a9 Remove keyword that chokes up IE tests 2014-03-05 15:07:19 -06:00
Kevin Decker 7dd64e5e92 Merge pull request #749 from jenseng/option_subexpressions_fix
properly handle multiple subexpressions in the same hash, fixes #748
2014-03-05 14:38:26 -06:00
Jon Jensen 8493822b62 properly handle multiple subexpressions in the same hash, fixes #748
push all hash params before popping any so as to avoid the last stackN var
stomping previous ones
2014-02-20 17:37:25 -06:00
jonahss c86ac60876 updated grunt-saucelabs, failing tests revealed 2014-02-18 16:14:31 -08:00
kpdecker 6da3c31494 Update compiler revision info 2014-02-10 01:50:32 -06:00
kpdecker 16f135835e Add support for depthed resolution of data fields 2014-02-09 18:35:22 -06:00
kpdecker 306feb497c Implement lookup helper 2014-02-09 17:22:18 -06:00
kpdecker a9f76e1475 jshint changes 2014-02-09 17:21:49 -06:00
kpdecker 14b7ef9066 Make raw blocks operate like blocks 2014-02-09 15:11:12 -06:00
Jesse Ezell 9b14dc40a5 raw block helpers 2014-02-09 14:41:32 -06:00
Jesse Ezell 954253305a Add {{{{ }}}} for raw blocks 2014-02-09 14:41:32 -06:00
kpdecker 7a7ad74ff1 Optimize buffer generate first and all edge cases 2014-02-09 14:24:18 -06:00
kpdecker 2812fe2775 Convert template spec to object literal
This allows for metadata to be associated with the template and a simplification of the template init logic.
2014-02-06 23:05:45 -08:00
kpdecker 49fcf10de2 Add contextPath tracking in builtin helpers 2014-01-17 23:15:18 -06:00
kpdecker ace2896ec8 Add trackIds compiler flag
Allows helpers that care about where a particular field came from derive this data while maintaining backward compatibility with existing helpers.
2014-01-17 23:15:17 -06:00
kpdecker 9df919083d Create track ids test stub 2014-01-17 23:15:17 -06:00
kpdecker 33921beaa0 Fix missing parameters for pathed mustaches
Fixes #658
2014-01-17 23:09:59 -06:00
kpdecker d4cfe90959 Allow decimal number values
Fixes #472
2014-01-17 20:42:02 -06:00
kpdecker fe4880feaa Allow implicit context iteration with each
Fixes #671
2014-01-17 20:13:00 -06:00
kpdecker e290ec24f1 Test more concrete behavior in partial hash test 2014-01-17 17:51:52 -06:00
kpdecker 45ae86a248 Implement partial hash evaluation 2014-01-17 17:51:52 -06:00
kpdecker f90981adf6 Add partial hash parser support 2014-01-17 17:51:52 -06:00
Kevin Decker 5659db4877 Merge pull request #634 from wycats/name-option
It would be great to have the helper name passed to `blockHelperMissing`
2014-01-15 08:42:32 -08:00
kpdecker f650b0d69e Expose the initial context via @root 2014-01-15 09:41:53 -06:00
kpdecker 0f328f375e Include name option for all helper calls
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
2014-01-06 16:07:56 -06:00
kpdecker 607748af3b Add better logging of test compile errors 2014-01-06 02:45:10 -06:00
kpdecker fc60f16475 Fix DATA value in stringParams mode
Fixes #699
2014-01-06 02:45:09 -06:00
kpdecker 6e4e1f8404 Include line info in compiler thrown exceptions
Fixes #636
2014-01-01 19:14:51 -06:00
kpdecker af3358d195 Fix multiple hash handling in subexpressions 2013-12-31 16:10:51 -06:00
machty b09333db79 Added support for subexpressions
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.
2013-12-30 19:07:04 -05:00
Blake Embrey 2f0c96b618 Make the environment reusable. 2013-12-28 21:35:40 -05:00
Stanley Stuart e1878050b5 add line numbers to nodes when parsing
closes #691
2013-12-28 18:55:36 -06:00
kpdecker 7311ab0b3f Use quotes for reserved token name
Fixes test exec under IE
2013-12-26 15:39:11 -06:00
kpdecker 7151d15abb Add AMD tests to sauce tests 2013-12-26 15:20:37 -06:00
kpdecker bbc7c7d080 Expose compilerInfo and checkRevision as APIs
Fixes #656
2013-12-23 21:00:59 -06:00
kpdecker 1a751b2f6e Add JavascriptCompiler public API tests 2013-12-23 20:59:16 -06:00
kpdecker 40e1837b14 Merge branch 'fix-escapes' of github.com:dmarcotte/handlebars.js into dmarcotte-fix-escapes
Conflicts:
	spec/tokenizer.js
2013-12-23 19:22:30 -06:00
kpdecker ddea5be2a4 Add AST test coverage for more complex paths 2013-12-23 19:02:45 -06:00
kpdecker 1a9b5d4ac6 Add test case to cover #676
Fixes #676
2013-12-23 15:42:38 -06:00
kpdecker 93fb25c702 Handle empty responses from partials
Fixes #675
2013-12-23 15:33:33 -06:00
kpdecker 7f53c917d9 Skip leak check under FF 2013-12-23 12:32:48 -06:00
kpdecker 015eba6687 Hide success messages when running in sauce
This should help debug the firefox issues that only occur when executing against sauce.
2013-12-23 11:57:11 -06:00