diff options
author | kpdecker <kpdecker@gmail.com> | 2015-08-18 23:57:27 -0700 |
---|---|---|
committer | kpdecker <kpdecker@gmail.com> | 2015-08-18 23:57:27 -0700 |
commit | 95d84badcae89aa72a6f1433b851304700320920 (patch) | |
tree | 78dfd5cad87cb77d4353484781ff580bcbf2ad1c /spec/compiler.js | |
parent | 9a2d1d6009406915d1ca177ed5321e4727b9776f (diff) | |
download | handlebars.js-95d84badcae89aa72a6f1433b851304700320920.zip handlebars.js-95d84badcae89aa72a6f1433b851304700320920.tar.gz handlebars.js-95d84badcae89aa72a6f1433b851304700320920.tar.bz2 |
Drop AST constructors in favor of JSON
These were little more than object literal statements that were less clear due to their use of index-based arguments.
Fixes #1077
Diffstat (limited to 'spec/compiler.js')
-rw-r--r-- | spec/compiler.js | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/spec/compiler.js b/spec/compiler.js index fe4b63a..be1fb00 100644 --- a/spec/compiler.js +++ b/spec/compiler.js @@ -39,7 +39,10 @@ describe('compiler', function() { }); it('can utilize AST instance', function() { - equal(Handlebars.compile(new Handlebars.AST.Program([ new Handlebars.AST.ContentStatement('Hello')], null, {}))(), 'Hello'); + equal(Handlebars.compile({ + type: 'Program', + body: [ {type: 'ContentStatement', value: 'Hello'}] + })(), 'Hello'); }); it('can pass through an empty string', function() { @@ -58,7 +61,10 @@ describe('compiler', function() { }); it('can utilize AST instance', function() { - equal(/return "Hello"/.test(Handlebars.precompile(new Handlebars.AST.Program([ new Handlebars.AST.ContentStatement('Hello')]), null, {})), true); + equal(/return "Hello"/.test(Handlebars.precompile({ + type: 'Program', + body: [ {type: 'ContentStatement', value: 'Hello'}] + })), true); }); it('can pass through an empty string', function() { |