Merge commit '87b5d4ee61605b026506e92c9e8873d867c5f150' into es6-modules
Conflicts: dist/handlebars.js dist/handlebars.runtime.js lib/handlebars/base.js lib/handlebars/utils.js
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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');
|
||||
},
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user