diff --git a/Gruntfile.js b/Gruntfile.js index 3468e4d38..b14536cd0 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -96,7 +96,7 @@ module.exports = function(grunt) { uglify: { options: { mangle: true, - compress: true, + compress: {}, preserveComments: 'some' }, dist: { @@ -169,10 +169,12 @@ module.exports = function(grunt) { // Build a new version of the library this.registerTask('build', "Builds a distributable version of the current project", [ + 'clean', + 'jshint', 'parser', 'node', - 'globals', - 'jshint']); + 'globals' + ]); this.registerTask('amd', ['packager:amd', 'requirejs']); this.registerTask('node', ['packager:cjs']); diff --git a/lib/handlebars/compiler/javascript-compiler.js b/lib/handlebars/compiler/javascript-compiler.js index 75390685f..c147464d6 100644 --- a/lib/handlebars/compiler/javascript-compiler.js +++ b/lib/handlebars/compiler/javascript-compiler.js @@ -11,6 +11,10 @@ JavaScriptCompiler.prototype = { // PUBLIC API: You can override these methods in a subclass to provide // alternative compiled forms for name lookup and buffering semantics nameLookup: function(parent, name /* , type*/) { + if (name === 'constructor') { + return ['(', parent, '.propertyIsEnumerable(\'constructor\') ? ', parent, '.constructor : undefined', ')']; + } + var wrap, ret; if (parent.indexOf('depth') === 0) { diff --git a/lib/handlebars/utils.js b/lib/handlebars/utils.js index ed2e1d8ff..c5da397d6 100644 --- a/lib/handlebars/utils.js +++ b/lib/handlebars/utils.js @@ -7,11 +7,12 @@ var escape = { ">": ">", '"': """, "'": "'", - "`": "`" + "`": "`", + '=': '=' }; -var badChars = /[&<>"'`]/g; -var possible = /[&<>"'`]/; +var badChars = /[&<>"'`=]/g; +var possible = /[&<>"'`=]/; function escapeChar(chr) { return escape[chr] || "&"; diff --git a/package.json b/package.json index 6403c5d46..159801960 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "handlebars", "barename": "handlebars", - "version": "1.3.0", + "version": "1.3.0-security-patch-1", "description": "Handlebars provides the power necessary to let you build semantic templates effectively with no frustration", "homepage": "http://www.handlebarsjs.com/", "keywords": [