diff --git a/static/scripts/libs/handlebars.runtime.js b/static/scripts/libs/handlebars.runtime.js index 987a5cd4d66..0866641947a 100644 --- a/static/scripts/libs/handlebars.runtime.js +++ b/static/scripts/libs/handlebars.runtime.js @@ -1,7 +1,11 @@ // lib/handlebars/base.js -var Handlebars = {}; -Handlebars.VERSION = "1.0.beta.6"; +/*jshint eqnull:true*/ +this.Handlebars = {}; + +(function(Handlebars) { + +Handlebars.VERSION = "1.0.rc.1"; Handlebars.helpers = {}; Handlebars.partials = {}; @@ -40,25 +44,36 @@ Handlebars.registerHelper('blockHelperMissing', function(context, options) { return inverse(this); } else if(type === "[object Array]") { if(context.length > 0) { - for(var i=0, j=context.length; i 0) { for(var i=0, j=context.length; i": ">", '"': """, @@ -122,7 +140,7 @@ Handlebars.SafeString.prototype.toString = function() { "`": "`" }; - var badChars = /&(?!\w+;)|[<>"'`]/g; + var badChars = /[&<>"'`]/g; var possible = /[&<>"'`]/; var escapeChar = function(chr) { @@ -204,7 +222,7 @@ Handlebars.VM = { }, noop: function() { return ""; }, invokePartial: function(partial, name, context, helpers, partials, data) { - options = { helpers: helpers, partials: partials, data: data }; + var options = { helpers: helpers, partials: partials, data: data }; if(partial === undefined) { throw new Handlebars.Exception("The partial " + name + " could not be found"); @@ -213,7 +231,7 @@ Handlebars.VM = { } else if (!Handlebars.compile) { throw new Handlebars.Exception("The partial " + name + " could not be compiled when running in runtime-only mode"); } else { - partials[name] = Handlebars.compile(partial); + partials[name] = Handlebars.compile(partial, {data: data !== undefined}); return partials[name](context, options); } }