kpdecker
1c863e34ab
Escape = in HTML content
...
There was a potential XSS exploit when using unquoted attributes that this should help reduce.
Fixes #1083
2016-02-08 18:56:04 +00:00
kpdecker
972f521718
Move noConflict implementation to module
...
DRYs the code to avoid escapes like #1004
Fixes #1004
2015-04-27 10:19:50 -05:00
kpdecker
fc13400b6f
Remove jshint completely
2015-04-27 10:19:49 -05:00
kpdecker
4bed826d0e
Update for let and optional parameters
2015-04-20 02:38:28 -05:00
kpdecker
e3d3eda2e1
Add full support for es6
...
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
2015-04-16 16:43:01 -05:00
kpdecker
a009a97a2e
Use captureStackTrace for error handler
...
Provides more stable error stack reporting when running under v8 environments.
2015-04-14 01:14:18 -05:00
kpdecker
54e743a09a
Allow this references in literal statements
...
Fixes #967
2015-04-14 01:12:39 -05:00
kpdecker
37a664bf64
Ignore branches tested without coverage monitoring
2015-04-07 23:38:05 -05:00
kpdecker
c699d0b82f
Remove vestigial code
2015-04-07 23:37:46 -05:00
kpdecker
2d149e7797
Add undefined and null literal support
...
This adds the UndefinedLiteral and NullLiteral to AST.
Fixes #990
2015-04-07 23:37:38 -05:00
kpdecker
81a4d50955
Avoid source-map import under AMD
...
Fixes #989
2015-04-07 22:35:14 -05:00
kpdecker
afe730e059
v3.0.1
2015-03-24 14:22:38 -05:00
kpdecker
ab96073c6b
Optimize hot path in escapeExpression
...
Avoid deoptimizations in v8 due to the duct type check on string instances.
Partial fix for #973
2015-03-16 22:06:01 -05:00
kpdecker
c15f90e513
Fix typo
2015-02-10 20:40:53 -06:00
kpdecker
0099e16a01
v3.0.0
2015-02-10 00:14:55 -06:00
kpdecker
39121cf8f5
Handle all potential literal values
...
Adds support for literal helper names in a few missing cases such as block expressions and subexpressions.
2015-02-09 23:54:46 -06:00
Marcio Junior
07f27843dc
Transform literals to path expressions in mustache nodes
2015-02-08 19:31:38 -02:00
Marcio Junior
5cc326d425
Test compilation of literal values in mustaches
2015-02-08 19:31:38 -02:00
kpdecker
cfbef2585d
Fail over to console.log if lacking console method
...
This improves logger resiliency under older browsers.
2015-02-07 13:23:10 -06:00
kpdecker
95421271e3
Change default log level to info
...
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
2015-02-07 12:31:19 -06:00
kpdecker
884bf15536
Avoid direct references to sexpr in statements
...
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.
2015-01-18 17:27:27 -06:00
kpdecker
cb51b82b8e
Add support for dynamic partial names
...
Uses the subexpression syntax to allow for dynamic partial lookups. Ex:
```
{{> (helper) }}
```
Fixes #933
2015-01-18 13:23:45 -06:00
Matthew Flaschen
c9d723e0fb
Add missing reserved words so compiler knows to use array syntax:
...
* 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.
2015-01-17 19:04:38 -05:00
Kevin Decker
96a5cf5ba1
Merge pull request #932 from wycats/strict
...
Implement strict and assumeObject modes
2014-12-31 19:28:05 -06:00
kpdecker
6650957f79
Implement strict and assumeObject modes
...
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
2014-12-27 14:59:36 -06:00
kpdecker
ec798a7c44
Merge branch 'master' into visitor-update
2014-12-27 13:30:20 -06:00
kpdecker
0a9fc171b0
Fix block param evaluation under older IE
2014-12-27 13:13:52 -06:00
kpdecker
b474630c7d
Strip unnecessary whitespace in template output
2014-12-27 12:58:28 -06:00
kpdecker
daa8f3dd05
Fix duplicate return statement on simple templates
2014-12-27 10:05:05 -06:00
kpdecker
be0ba75925
Fix case-insensitive file system compile issue
2014-12-26 11:34:48 -06:00
kpdecker
9ff3daf785
Add parent tracking and mutation to AST visitors
...
Fixes #916
2014-12-26 11:32:30 -06:00
kpdecker
8babe05953
Bump code coverage
2014-12-26 11:12:47 -06:00
kpdecker
396795c983
Implement block parameters
...
Fixes #907
2014-12-26 00:31:57 -06:00
kpdecker
9e907e6785
Expose AST helpers in public API
2014-12-21 22:32:50 -06:00
kpdecker
6d2239d8ac
Update fix for #926 for 3.0 codeline
2014-12-17 00:40:28 -06:00
kpdecker
59e80c5103
Track depths on deduped children
...
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
2014-12-16 17:59:32 -06:00
kpdecker
69b1bdd32e
Avoid unnecessary this. reference
2014-12-16 12:57:46 -06:00
kpdecker
c05fad8b18
Fix remaining depth arg
2014-12-16 12:57:46 -06:00
kpdecker
203df9d5b7
Remove unused vars and add jshint checking
2014-12-16 12:57:46 -06:00
kpdecker
0d396ccd30
Remove Compiler.depths parameter
...
This is no longer necessary with the depths array tracking and adds compiler overhead.
2014-12-16 12:57:46 -06:00
Or Neeman
e7f51c2248
Add instructions for 'spec/mustache' to CONTRIBUTING.md, fix a few typos elsewere
2014-12-07 09:00:56 -06:00
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
b6ba2dcdb0
Move compileProgram out of visitor methods
2014-11-29 18:02:58 -06:00
kpdecker
5b0efc7e91
Track source node via accept call rather vs opcode
2014-11-29 18:02:58 -06:00
kpdecker
a655aedb5c
s/Subexpression/SubExpression/
2014-11-29 17:59:09 -06:00
kpdecker
928ba56b95
Rework strip flags to make clearer at in AST level
...
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.
2014-11-28 23:13:06 -06:00
kpdecker
8a6796e5c0
Move Jison parsing out of AST into helpers
2014-11-28 17:26:52 -06:00
kpdecker
ffc9fb5007
Add original to BooleanLiteral
2014-11-28 16:55:41 -06:00
kpdecker
6a7a8c803d
Rename AST objects to match type names
2014-11-28 14:42:24 -06:00