kpdecker
f84f76f006
Add basic docs for JavaScriptCompiler override API
2014-11-29 18:20:11 -06:00
kpdecker
96c1300f15
Drop unused JavaScriptCompiler.namespace param
2014-11-29 18:11:58 -06:00
kpdecker
f990cf0064
Treat partial exec in a manner closer to helpers
...
This helps unify the code handling and will also be needed to support string/id tracking on partials.
2014-11-27 09:11:03 -06:00
kpdecker
1124908d2a
Update subexpression and hash AST constructs
2014-11-27 08:37:48 -06:00
kpdecker
5c921cafeb
Replace DataNode and IdNode with PathNode
...
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.
2014-11-26 20:36:36 -06:00
kpdecker
61dd721ca2
Update AST location info to match SpiderMonkey
...
Part of #889
2014-11-26 09:01:03 -06:00
kpdecker
d044a8c99d
Optimize variable declaration
2014-11-25 23:15:11 -06:00
kpdecker
4a2afa9d02
Propagate options for client compiled partials
...
Fixes #901
2014-11-08 19:06:40 -06:00
kpdecker
ac208b1bcd
Only provide aliases for multiple use calls
...
Fixes #903
2014-11-08 18:53:43 -06:00
kpdecker
1429587dd4
Provide default mapping for boilerplate code
2014-11-08 17:50:01 -06:00
kpdecker
3ee0682247
Generate source maps
...
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.
2014-11-08 17:50:01 -06:00
kpdecker
249f559104
Include location information in all opcodes
2014-11-08 17:50:01 -06:00
kpdecker
d595ebc0e2
Simplify program generation logic
2014-11-08 14:36:17 -06:00
kpdecker
d47e4dd1f7
Bump test coverage
2014-11-08 14:35:23 -06:00
kpdecker
83bcbee222
Ignore unused code paths
...
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.
2014-11-08 14:35:23 -06:00
kpdecker
30034c75e7
Merge setupParams and setupOptions
2014-11-06 09:43:43 -06:00
kpdecker
d3bd1a523d
Simplify flushInline implementation
2014-11-05 23:23:43 -06:00
kpdecker
9665379cdc
Use terinary operator for inline appends
...
Allows for append operations to avoid breaking inline chain.
2014-11-05 22:28:12 -06:00
kpdecker
4f01f650dc
Render false literal as “false”
...
Fixes #827
2014-08-25 23:35:43 -05:00
kpdecker
ca1486b960
Prune unused code
2014-08-25 22:39:17 -05:00
kpdecker
0c7c37df6a
Restore helperMissing for ambiguous statements
...
Fixes #318 (regression)
Partial fix for #783
2014-08-23 18:26:57 -05:00
kpdecker
cde008b49f
Cleanup from code coverage report
2014-08-23 17:44:45 -05:00
kpdecker
84d646bb5d
Move strip processing into AST helper logic
...
We already have to track these behaviors for the standalone parsing and rather than having two whitespace pruning implementations this moves all of the behavior into one place.
Fixes #852
2014-08-23 17:44:20 -05:00
kpdecker
3531e04117
Optimize replaceStack for inline methods
...
Only use case was with inline input so most of this code was unnecessary.
2014-08-23 07:43:09 -05:00
kpdecker
c3fde1c01c
Remove unnecessary stack variable from blockHelper
2014-08-23 07:42:24 -05:00
kpdecker
19ce981296
Do not flush subexpressions
...
They are no longer duplicated with the new helper calling pattern and this also introduced stack corruption issues due to improper value lookups.
Fixes #767
Fixes #768
2014-08-23 07:36:01 -05:00
kpdecker
3ce105ae89
Fix undefined handling for pathed lookups
...
Fixes #837
2014-08-15 01:45:50 -05:00
kpdecker
f2b5519e76
Strip dead code from javascript compiler
2014-08-15 00:40:07 -05:00
kpdecker
cc5de5df3c
Fix compat partial exec without data
2014-08-15 00:38:23 -05:00
kpdecker
d05245b5f5
Make depthed lookup call non-literal
...
Prevents duplicate calls from being made.
2014-08-15 00:37:57 -05:00
kpdecker
3cea85b2b0
Drop unused DECLARE opcode
2014-08-14 12:27:02 -05:00
kpdecker
cb22ee5681
Increase test coverage a touch
2014-08-14 12:25:35 -05:00
kpdecker
9f8110fe15
Implement partial recursive lookup
2014-08-14 00:29:25 -05:00
kpdecker
0edce6e1d1
Inherit compat flag for partials
2014-08-14 00:29:25 -05:00
kpdecker
c98613b711
Implement recursive field lookup in compat mode
...
Provides the mustache behavior of recursive lookup without the use of depthed paths.
Note that this does incur a fairly dramatic performance penalty for depthed queries.
2014-08-13 20:46:42 -05:00
kpdecker
b695aaec7c
Use depths array rather than passing array args
...
Approximately doubles the throughput performance of depthed templates and clears the way for doing recursive path lookups in pathed mode.
2014-08-13 14:11:53 -05:00
kpdecker
f6dc5ad716
Create contextName helper for context lookup
2014-08-13 11:41:27 -05:00
kpdecker
e93d516672
Render indent for standalone partials
2014-08-12 14:41:58 -05:00
kpdecker
63c5eb7a82
Remove unused JSCompiler.register method
2014-08-11 20:10:12 -05:00
kpdecker
271106d43f
Do not lookup pathed helpers on the helper stack
...
Fixes #764
2014-07-12 12:50:54 -05:00
kpdecker
1fb7b51ee6
Fix rendering of paths that resolve to zero
...
Fixes #820
2014-07-12 11:43:45 -05:00
kpdecker
c90cfe247c
Use ID lookup for ambiguous helper evaluation
...
Final change for #731
2014-07-07 00:20:02 -05:00
kpdecker
b5a5c76ceb
Rework lookup null protector logic
...
- 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
2014-07-06 23:41:15 -05:00
kpdecker
4aad72d223
Move lambda resolution to runtime
...
This has a very positive impact on precompiled output size, particularly for known-helpers cases, and little or no impact on the throughput numbers.
2014-07-06 12:53:01 -05:00
kpdecker
b79e31e5a5
Remove disassemble log statement
...
Fixes #772
2014-06-28 18:44:11 -07:00
kpdecker
55782f08c5
Fix evaluation of paths and subexprs
...
Fixes #743
2014-03-05 17:49:39 -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
5999baf746
fix bug in IE<=8 (no Array::map), closes #751
...
looks like this broke in 2812fe27
also s/this.i/var i/, since the functions that needed it were removed in
a1edab6ef
2014-03-04 22:18:50 -07: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
kpdecker
16f135835e
Add support for depthed resolution of data fields
2014-02-09 18:35:22 -06:00