Michael Jackson
e0edb356ae
Fail gracefully on empty template
Fixes #267
vor 13 Jahren
Matt Sacks
d59f02f622
Don't evaluate lambdas that return falsy values as an empty string.
Issue: If I create a Mustache lambda to return numbers and I expect 0 to be of
those numbers, I'll instead only receive an empty string for 0 because it
evaluates to falsy.
Fix: Check the result of the lambda to be undefined or null. Only then should
it return the empty string.
vor 13 Jahren
Michael Jackson
26dfacd8be
Add Mustache.compileTokens
Fixes #258
vor 13 Jahren
Michael Jackson
85014a4f6c
Add spec for partial caching issue
vor 13 Jahren
Michael Jackson
afc6e0f1b1
Changed wording of some specs
vor 13 Jahren
Michael Jackson
0ea95746a8
Allow auto-loading of partials
Fixes #247
vor 13 Jahren
Michael Jackson
a5dbb708d7
Fix text token offsets
Text tokens now accurately reflect their content's exact position
in the original template.
vor 13 Jahren
Michael Jackson
0a6d71ca90
Add tests for null view
vor 13 Jahren
Michael Jackson
18e797d47e
Coerce { token types to &
vor 13 Jahren
Michael Jackson
3fb61fc056
More concise token format
vor 13 Jahren
Michael Jackson
be4fd1cc29
Text passed to higher-order sections unrendered
Fixes #187
vor 13 Jahren
Michael Jackson
5ab345eddf
Use JavaScript's definition of falsy
Fixes #186
vor 13 Jahren
Michael Jackson
a8a0392cd6
Added 3-level deep nesting test
Fixes #42
vor 13 Jahren
Michael Jackson
9e6943c867
Scanner returns empty string if it can't match
vor 13 Jahren
Michael Jackson
a7a6e742d1
Use @cweider's quoting function
Also fixed a bug that occurs when using the triple-stache with a key
that contains a closing stache. Fixes #192 .
vor 14 Jahren
Michael Jackson
b8a14eafe9
Strict escaping of ampersands
vor 14 Jahren
Michael Jackson
eda5173061
Remove Ruby dependency
vor 14 Jahren
Michael Jackson
8efd0538cf
This test should not work
vor 14 Jahren
Michael Jackson
fbc66a8140
Another rewrite
- Cleaner separation of responsibilities in the code between
scanning, parsing, compiling, and rendering functions.
- Much faster
vor 14 Jahren
Michael Jackson
f127f48bf4
Move all tests to spec directory
vor 14 Jahren
Michael Jackson
0e49002087
Add node to test suite
vor 14 Jahren
Michael Jackson
9867b8d917
Clean up runner.js
vor 14 Jahren
Michael Jackson
89863d714b
Use rake/clean
vor 14 Jahren
Jan Lehnardt
671f8eaa52
add SpiderMonkey test runner
vor 14 Jahren
Ben Cherry
4fd1b8bd3b
Check for existence of engines before running tests, better logging
vor 14 Jahren
Ben Cherry
58bf8da9ba
re-link jsc and add a bit more doc
vor 15 Jahren
Ben Cherry
deff91a4e0
made gettext return the right thing for translation-hint mode
vor 15 Jahren
Ben Cherry
5467067bee
remove commented out lines from run_js
vor 15 Jahren
Ben Cherry
373e263973
moved new tests into new examples/* files
vor 15 Jahren
Ben Cherry
b15c6fb842
tests for brokenness, now in Rhino too
vor 15 Jahren
Ben Cherry
d5e54b409a
works with empty sections
vor 15 Jahren
Ben Cherry
5dc7c74e9b
failing tests
vor 15 Jahren
Ben Cherry
6a9da0581a
stubbed _() for tests, and basic i18n test
vor 15 Jahren
Ben Cherry
99afe5fea7
don't double render
vor 15 Jahren
Jan Lehnardt
328724ad43
whitespace
vor 16 Jahren
Alexander Lang
c12ba296ab
added testcase for issue #26
vor 16 Jahren
Jan Lehnardt
2c8857e84a
remove extra semicolon
vor 16 Jahren
Jan Lehnardt
272fd0fc1f
fix test case
vor 16 Jahren
Chris Anderson
a354b55156
more send fun goodness
vor 16 Jahren
Chris Anderson
f864a27cb9
make the tests also test a generic send function (reveals failures)
vor 16 Jahren
Jan Lehnardt
0bb4776def
mustache compat: Don't barf on unknown variables.
vor 16 Jahren
Paul J. Davis
895e741234
Fix error message consistency.
vor 16 Jahren
Paul J. Davis
3a9eda10b4
Avoid requiring partials in global scope.
vor 16 Jahren
Sebastian Cohnen
5f31d4cbc2
Re-enabled test for clean context in case of recursion
vor 16 Jahren
Alexander Lang
093a5b84da
fixed bug where recursion overwrote data in the parent context
vor 16 Jahren
Alexander Lang
697bca307a
fixed bug where mustache had access to data from previous runs
vor 16 Jahren
Alexander Lang
437056a7e7
added processing arrays of plain values
vor 16 Jahren
Alexander Lang
7549f18940
converted test suite to rspec
vor 16 Jahren
Jan Lehnardt
0a466bfce3
add mustache tests, implement partials
vor 16 Jahren
Jan Lehnardt
0e11ce9ee5
initial drop
vor 16 Jahren