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:
kpdecker
2013-09-02 16:19:28 -05:00
11 changed files with 96 additions and 64 deletions
+1 -1
View File
@@ -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');
},
+2 -2
View File
@@ -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);