summaryrefslogtreecommitdiffstats
path: root/lib/handlebars/compiler/compiler.js
diff options
context:
space:
mode:
authorkpdecker <kpdecker@gmail.com>2015-08-18 23:57:27 -0700
committerkpdecker <kpdecker@gmail.com>2015-08-18 23:57:27 -0700
commit95d84badcae89aa72a6f1433b851304700320920 (patch)
tree78dfd5cad87cb77d4353484781ff580bcbf2ad1c /lib/handlebars/compiler/compiler.js
parent9a2d1d6009406915d1ca177ed5321e4727b9776f (diff)
downloadhandlebars.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 'lib/handlebars/compiler/compiler.js')
-rw-r--r--lib/handlebars/compiler/compiler.js9
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/handlebars/compiler/compiler.js b/lib/handlebars/compiler/compiler.js
index 59a425f..c8db7c9 100644
--- a/lib/handlebars/compiler/compiler.js
+++ b/lib/handlebars/compiler/compiler.js
@@ -514,6 +514,13 @@ function transformLiteralToPath(sexpr) {
let literal = sexpr.path;
// Casting to string here to make false and 0 literal values play nicely with the rest
// of the system.
- sexpr.path = new AST.PathExpression(false, 0, [literal.original + ''], literal.original + '', literal.loc);
+ sexpr.path = {
+ type: 'PathExpression',
+ data: false,
+ depth: 0,
+ parts: [literal.original + ''],
+ original: literal.original + '',
+ loc: literal.loc
+ };
}
}