diff options
author | kpdecker <kpdecker@gmail.com> | 2013-09-02 16:19:28 -0500 |
---|---|---|
committer | kpdecker <kpdecker@gmail.com> | 2013-09-02 16:19:28 -0500 |
commit | 192887cedce6e6155bb1a079ab2802ff28fbd2bf (patch) | |
tree | 8d4165b322cac9c54ecbd94743403d5937070f2a /lib | |
parent | 530f1903aa8ceb80b632d4dc12fcb701b046a946 (diff) | |
parent | 87b5d4ee61605b026506e92c9e8873d867c5f150 (diff) | |
download | handlebars.js-192887cedce6e6155bb1a079ab2802ff28fbd2bf.zip handlebars.js-192887cedce6e6155bb1a079ab2802ff28fbd2bf.tar.gz handlebars.js-192887cedce6e6155bb1a079ab2802ff28fbd2bf.tar.bz2 |
Merge commit '87b5d4ee61605b026506e92c9e8873d867c5f150' into es6-modules
Conflicts:
dist/handlebars.js
dist/handlebars.runtime.js
lib/handlebars/base.js
lib/handlebars/utils.js
Diffstat (limited to 'lib')
-rw-r--r-- | lib/handlebars/base.js | 2 | ||||
-rw-r--r-- | lib/handlebars/compiler/javascript-compiler.js | 6 | ||||
-rw-r--r-- | lib/handlebars/utils.js | 4 |
3 files changed, 6 insertions, 6 deletions
diff --git a/lib/handlebars/base.js b/lib/handlebars/base.js index 2e0411d..a6cd7ff 100644 --- a/lib/handlebars/base.js +++ b/lib/handlebars/base.js @@ -117,7 +117,7 @@ function registerDefaultHelpers(instance) { var type = toString.call(conditional); if(type === functionType) { conditional = conditional.call(this); } - if(!conditional || isEmpty(conditional)) { + if (isEmpty(conditional)) { return options.inverse(this); } else { return options.fn(this); diff --git a/lib/handlebars/compiler/javascript-compiler.js b/lib/handlebars/compiler/javascript-compiler.js index a416431..d3bd258 100644 --- a/lib/handlebars/compiler/javascript-compiler.js +++ b/lib/handlebars/compiler/javascript-compiler.js @@ -348,10 +348,10 @@ JavaScriptCompiler.prototype = { // [lookupData] // // On stack, before: ... - // On stack, after: data[id], ... + // On stack, after: data, ... // - // Push the result of looking up `id` on the current data - lookupData: function(id) { + // Push the data lookup operator + lookupData: function() { this.push('data'); }, diff --git a/lib/handlebars/utils.js b/lib/handlebars/utils.js index d14795c..26d2b54 100644 --- a/lib/handlebars/utils.js +++ b/lib/handlebars/utils.js @@ -19,7 +19,7 @@ export function SafeString(string) { }; SafeString.prototype.toString = function() { - return this.string.toString(); + return "" + this.string; }; var escape = { @@ -57,7 +57,7 @@ export function escapeExpression(string) { // Force a string conversion as this will be done by the append regardless and // the regex test will do this transparently behind the scenes, causing issues if // an object's to string has escaped characters in it. - string = string.toString(); + string = "" + string; if(!possible.test(string)) { return string; } return string.replace(badChars, escapeChar); |