From 0aef72cb8ee694911952d5447b08349a952aee90 Mon Sep 17 00:00:00 2001 From: kpdecker Date: Tue, 1 Sep 2015 17:56:32 -0500 Subject: [PATCH 01/10] Update to latest eslint --- .eslintrc | 8 ++++---- Gruntfile.js | 2 +- bench/throughput.js | 2 +- lib/handlebars/compiler/code-gen.js | 2 +- lib/handlebars/compiler/javascript-compiler.js | 4 ++-- lib/handlebars/compiler/printer.js | 4 ++-- lib/handlebars/no-conflict.js | 2 +- lib/handlebars/utils.js | 4 ++-- lib/precompiler.js | 2 +- package.json | 2 +- spec/basic.js | 4 ++-- spec/builtins.js | 4 ++-- spec/env/browser.js | 4 ++-- spec/env/node.js | 4 ++-- spec/env/runner.js | 8 +++----- spec/env/runtime.js | 4 ++-- spec/javascript-compiler.js | 4 ++-- spec/precompiler.js | 2 +- spec/regressions.js | 4 ++-- spec/spec.js | 4 ++-- 20 files changed, 36 insertions(+), 38 deletions(-) diff --git a/.eslintrc b/.eslintrc index 237b5ee6d..8cd3bd6fe 100644 --- a/.eslintrc +++ b/.eslintrc @@ -40,7 +40,7 @@ "no-dupe-keys": 2, "no-duplicate-case": 2, "no-empty": 2, - "no-empty-class": 2, + "no-empty-character-class": 2, "no-ex-assign": 2, "no-extra-boolean-cast": 2, "no-extra-parens": 0, @@ -55,7 +55,7 @@ "no-negated-in-lhs": 2, "no-obj-calls": 2, "no-regex-spaces": 2, - "no-reserved-keys": 2, // Important for IE + "quote-props": [2, "as-needed", {"keywords": true}], "no-sparse-arrays": 0, // Optimizer and coverage will handle/highlight this and can be useful for debugging @@ -175,7 +175,7 @@ "no-ternary": 0, "no-trailing-spaces": 2, "no-underscore-dangle": 0, - "no-wrap-func": 2, + "no-extra-parens": [2, "functions"], "one-var": 0, "operator-assignment": 0, "padded-blocks": 0, @@ -192,7 +192,7 @@ "space-infix-ops": 2, "space-return-throw-case": 2, "space-unary-ops": 2, - "spaced-line-comment": 2, + "spaced-comment": [2, "always", {"markers": [","]}], "wrap-regex": 1, "no-var": 1 diff --git a/Gruntfile.js b/Gruntfile.js index 2850a9052..3bb1c1661 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -1,4 +1,4 @@ -/*eslint-disable no-process-env */ +/* eslint-disable no-process-env */ module.exports = function(grunt) { grunt.initConfig({ diff --git a/bench/throughput.js b/bench/throughput.js index 9f1f79858..e8ea5d910 100644 --- a/bench/throughput.js +++ b/bench/throughput.js @@ -1,7 +1,7 @@ var _ = require('underscore'), runner = require('./util/template-runner'), - eco, dust, Handlebars, Mustache, eco; + eco, dust, Handlebars, Mustache; try { dust = require('dustjs-linkedin'); diff --git a/lib/handlebars/compiler/code-gen.js b/lib/handlebars/compiler/code-gen.js index 6541fe873..5ec052f77 100644 --- a/lib/handlebars/compiler/code-gen.js +++ b/lib/handlebars/compiler/code-gen.js @@ -1,4 +1,4 @@ -/*global define */ +/* global define */ import {isArray} from '../utils'; let SourceNode; diff --git a/lib/handlebars/compiler/javascript-compiler.js b/lib/handlebars/compiler/javascript-compiler.js index ede0b5e49..ff583c794 100644 --- a/lib/handlebars/compiler/javascript-compiler.js +++ b/lib/handlebars/compiler/javascript-compiler.js @@ -471,7 +471,7 @@ JavaScriptCompiler.prototype = { let len = parts.length; for (; i < len; i++) { - /*eslint-disable no-loop-func */ + /* eslint-disable no-loop-func */ this.replaceStack((current) => { let lookup = this.nameLookup(current, parts[i], type); // We want to ensure that zero and false are handled properly if the context (falsy flag) @@ -483,7 +483,7 @@ JavaScriptCompiler.prototype = { return [' && ', lookup]; } }); - /*eslint-enable no-loop-func */ + /* eslint-enable no-loop-func */ } }, diff --git a/lib/handlebars/compiler/printer.js b/lib/handlebars/compiler/printer.js index 66e7c7d4b..6ad43baec 100644 --- a/lib/handlebars/compiler/printer.js +++ b/lib/handlebars/compiler/printer.js @@ -1,4 +1,4 @@ -/*eslint-disable new-cap */ +/* eslint-disable new-cap */ import Visitor from './visitor'; export function print(ast) { @@ -168,4 +168,4 @@ PrintVisitor.prototype.Hash = function(hash) { PrintVisitor.prototype.HashPair = function(pair) { return pair.key + '=' + this.accept(pair.value); }; -/*eslint-enable new-cap */ +/* eslint-enable new-cap */ diff --git a/lib/handlebars/no-conflict.js b/lib/handlebars/no-conflict.js index a421f57e5..ad41e96fa 100644 --- a/lib/handlebars/no-conflict.js +++ b/lib/handlebars/no-conflict.js @@ -1,4 +1,4 @@ -/*global window */ +/* global window */ export default function(Handlebars) { /* istanbul ignore next */ let root = typeof global !== 'undefined' ? global : window, diff --git a/lib/handlebars/utils.js b/lib/handlebars/utils.js index d34646b7d..1cf7e3219 100644 --- a/lib/handlebars/utils.js +++ b/lib/handlebars/utils.js @@ -31,7 +31,7 @@ export let toString = Object.prototype.toString; // Sourced from lodash // https://github.com/bestiejs/lodash/blob/master/LICENSE.txt -/*eslint-disable func-style */ +/* eslint-disable func-style */ let isFunction = function(value) { return typeof value === 'function'; }; @@ -43,7 +43,7 @@ if (isFunction(/x/)) { }; } export {isFunction}; -/*eslint-enable func-style */ +/* eslint-enable func-style */ /* istanbul ignore next */ export const isArray = Array.isArray || function(value) { diff --git a/lib/precompiler.js b/lib/precompiler.js index 9f23ef661..a20d1419d 100644 --- a/lib/precompiler.js +++ b/lib/precompiler.js @@ -1,4 +1,4 @@ -/*eslint-disable no-console */ +/* eslint-disable no-console */ import Async from 'async'; import fs from 'fs'; import * as Handlebars from './handlebars'; diff --git a/package.json b/package.json index 814e5277e..2fc5e12aa 100644 --- a/package.json +++ b/package.json @@ -46,7 +46,7 @@ "grunt-contrib-requirejs": "0.x", "grunt-contrib-uglify": "0.x", "grunt-contrib-watch": "0.x", - "grunt-eslint": "^11.0.0", + "grunt-eslint": "^17.1.0", "grunt-saucelabs": "8.x", "grunt-webpack": "^1.0.8", "istanbul": "^0.3.0", diff --git a/spec/basic.js b/spec/basic.js index 8859545d9..e4b253665 100644 --- a/spec/basic.js +++ b/spec/basic.js @@ -61,14 +61,14 @@ describe('basic context', function() { shouldCompileTo('num: {{num1/num2}}', {num1: {num2: 0}}, 'num: 0'); }); it('false', function() { - /*eslint-disable no-new-wrappers */ + /* eslint-disable no-new-wrappers */ shouldCompileTo('val1: {{val1}}, val2: {{val2}}', {val1: false, val2: new Boolean(false)}, 'val1: false, val2: false'); shouldCompileTo('val: {{.}}', false, 'val: false'); shouldCompileTo('val: {{val1/val2}}', {val1: {val2: false}}, 'val: false'); shouldCompileTo('val1: {{{val1}}}, val2: {{{val2}}}', {val1: false, val2: new Boolean(false)}, 'val1: false, val2: false'); shouldCompileTo('val: {{{val1/val2}}}', {val1: {val2: false}}, 'val: false'); - /*eslint-enable */ + /* eslint-enable */ }); it('should handle undefined and null', function() { diff --git a/spec/builtins.js b/spec/builtins.js index f06a1ad23..dc1df0a3e 100644 --- a/spec/builtins.js +++ b/spec/builtins.js @@ -257,7 +257,7 @@ describe('builtin helpers', function() { }); describe('#log', function() { - /*eslint-disable no-console */ + /* eslint-disable no-console */ if (typeof console === 'undefined') { return; } @@ -408,7 +408,7 @@ describe('builtin helpers', function() { shouldCompileTo(string, hash, ''); equals(true, called); }); - /*eslint-enable no-console */ + /* eslint-enable no-console */ }); diff --git a/spec/env/browser.js b/spec/env/browser.js index c9414d402..8049dda0e 100644 --- a/spec/env/browser.js +++ b/spec/env/browser.js @@ -19,12 +19,12 @@ global.CompilerContext = { }; function safeEval(templateSpec) { - /*eslint-disable no-eval, no-console */ + /* eslint-disable no-eval, no-console */ try { return eval('(' + templateSpec + ')'); } catch (err) { console.error(templateSpec); throw err; } - /*eslint-enable no-eval, no-console */ + /* eslint-enable no-eval, no-console */ } diff --git a/spec/env/node.js b/spec/env/node.js index 62d9fe9b6..881609d2e 100644 --- a/spec/env/node.js +++ b/spec/env/node.js @@ -13,12 +13,12 @@ global.CompilerContext = { }; function safeEval(templateSpec) { - /*eslint-disable no-eval, no-console */ + /* eslint-disable no-eval, no-console */ try { return eval('(' + templateSpec + ')'); } catch (err) { console.error(templateSpec); throw err; } - /*eslint-enable no-eval, no-console */ + /* eslint-enable no-eval, no-console */ } diff --git a/spec/env/runner.js b/spec/env/runner.js index 98d2482e8..4ff1e7e48 100644 --- a/spec/env/runner.js +++ b/spec/env/runner.js @@ -1,4 +1,4 @@ -/*eslint-disable no-console */ +/* eslint-disable no-console */ var fs = require('fs'), Mocha = require('mocha'), path = require('path'); @@ -7,8 +7,6 @@ var errors = 0, testDir = path.dirname(__dirname), grep = process.argv[2]; -var files = [ testDir + '/basic.js' ]; - var files = fs.readdirSync(testDir) .filter(function(name) { return (/.*\.js$/).test(name); }) .map(function(name) { return testDir + '/' + name; }); @@ -16,9 +14,9 @@ var files = fs.readdirSync(testDir) run('./runtime', function() { run('./browser', function() { run('./node', function() { - /*eslint-disable no-process-exit */ + /* eslint-disable no-process-exit */ process.exit(errors); - /*eslint-enable no-process-exit */ + /* eslint-enable no-process-exit */ }); }); }); diff --git a/spec/env/runtime.js b/spec/env/runtime.js index a7b42f51e..9d1c04995 100644 --- a/spec/env/runtime.js +++ b/spec/env/runtime.js @@ -39,12 +39,12 @@ global.CompilerContext = { }; function safeEval(templateSpec) { - /*eslint-disable no-eval, no-console */ + /* eslint-disable no-eval, no-console */ try { return eval('(' + templateSpec + ')'); } catch (err) { console.error(templateSpec); throw err; } - /*eslint-enable no-eval, no-console */ + /* eslint-enable no-eval, no-console */ } diff --git a/spec/javascript-compiler.js b/spec/javascript-compiler.js index 28e698824..5a10388f0 100644 --- a/spec/javascript-compiler.js +++ b/spec/javascript-compiler.js @@ -16,9 +16,9 @@ describe('javascript-compiler api', function() { handlebarsEnv.JavaScriptCompiler.prototype.nameLookup = function(parent, name) { return parent + '.bar_' + name; }; - /*eslint-disable camelcase */ + /* eslint-disable camelcase */ shouldCompileTo('{{foo}}', { bar_foo: 'food' }, 'food'); - /*eslint-enable camelcase */ + /* eslint-enable camelcase */ }); // Tests nameLookup dot vs. bracket behavior. Bracket is required in certain cases diff --git a/spec/precompiler.js b/spec/precompiler.js index e1ad5ade9..f9759a9ce 100644 --- a/spec/precompiler.js +++ b/spec/precompiler.js @@ -1,4 +1,4 @@ -/*eslint-disable no-console */ +/* eslint-disable no-console */ describe('precompiler', function() { // NOP Under non-node environments if (typeof process === 'undefined') { diff --git a/spec/regressions.js b/spec/regressions.js index e8942a484..825ee35ac 100644 --- a/spec/regressions.js +++ b/spec/regressions.js @@ -103,13 +103,13 @@ describe('Regressions', function() { }); it('GH-534: Object prototype aliases', function() { - /*eslint-disable no-extend-native */ + /* eslint-disable no-extend-native */ Object.prototype[0xD834] = true; shouldCompileTo('{{foo}}', { foo: 'bar' }, 'bar'); delete Object.prototype[0xD834]; - /*eslint-enable no-extend-native */ + /* eslint-enable no-extend-native */ }); it('GH-437: Matching escaping', function() { diff --git a/spec/spec.js b/spec/spec.js index ae1ec3805..221d32ec2 100644 --- a/spec/spec.js +++ b/spec/spec.js @@ -34,9 +34,9 @@ describe('spec', function() { var data = _.clone(test.data); if (data.lambda) { // Blergh - /*eslint-disable no-eval */ + /* eslint-disable no-eval */ data.lambda = eval('(' + data.lambda.js + ')'); - /*eslint-enable no-eval */ + /* eslint-enable no-eval */ } it(name + ' - ' + test.name, function() { if (test.partials) { From 454d20e3b224d715a19c66ddcc6cb2ba273243d2 Mon Sep 17 00:00:00 2001 From: kpdecker Date: Wed, 2 Sep 2015 11:40:35 -0500 Subject: [PATCH 02/10] Remove keen code MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This hasn’t been running and is horribly out of date. --- package.json | 3 +-- tasks/metrics.js | 44 ++------------------------------------------ 2 files changed, 3 insertions(+), 44 deletions(-) diff --git a/package.json b/package.json index 2fc5e12aa..a7cf883a7 100644 --- a/package.json +++ b/package.json @@ -29,7 +29,7 @@ "uglify-js": "~2.4" }, "devDependencies": { - "async": "^0.9.0", + "async": "^1.4.2", "aws-sdk": "~1.5.0", "babel-loader": "^5.0.0", "babel-runtime": "^5.1.10", @@ -51,7 +51,6 @@ "grunt-webpack": "^1.0.8", "istanbul": "^0.3.0", "jison": "~0.3.0", - "keen.io": "0.0.3", "mocha": "~1.20.0", "mock-stdin": "^0.3.0", "mustache": "0.x", diff --git a/tasks/metrics.js b/tasks/metrics.js index 9044306cf..b04967dd0 100644 --- a/tasks/metrics.js +++ b/tasks/metrics.js @@ -1,25 +1,12 @@ var _ = require('underscore'), async = require('async'), - git = require('./util/git'), - Keen = require('keen.io'), metrics = require('../bench'); module.exports = function(grunt) { grunt.registerTask('metrics', function() { var done = this.async(), execName = grunt.option('name'), - events = {}, - - projectId = process.env.KEEN_PROJECTID, - writeKey = process.env.KEEN_WRITEKEY, - keen; - - if (!execName && projectId && writeKey) { - keen = Keen.configure({ - projectId: projectId, - writeKey: writeKey - }); - } + events = {}; async.each(_.keys(metrics), function(name, complete) { if (/^_/.test(name) || (execName && name !== execName)) { @@ -31,33 +18,6 @@ module.exports = function(grunt) { complete(); }); }, - function() { - if (!keen) { - return done(); - } - - emit(keen, events, function(err) { - if (err) { - throw err; - } - - grunt.log.writeln('Metrics recorded.'); - done(); - }); - }); + done); }); }; -function emit(keen, collections, callback) { - git.commitInfo(function(err, info) { - _.each(collections, function(collection) { - _.each(collection, function(event) { - if (info.tagName) { - event.tag = info.tagName; - } - event.sha = info.head; - }); - }); - - keen.addEvents(collections, callback); - }); -} From cc8ed7a9e7e9b025b1511a90c295b3716612d1de Mon Sep 17 00:00:00 2001 From: kpdecker Date: Wed, 2 Sep 2015 11:40:59 -0500 Subject: [PATCH 03/10] Update subset of npm packages --- package.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index a7cf883a7..76f6552a1 100644 --- a/package.json +++ b/package.json @@ -23,14 +23,14 @@ "dependencies": { "async": "^1.4.0", "optimist": "^0.6.1", - "source-map": "^0.1.40" + "source-map": "^0.4.4" }, "optionalDependencies": { "uglify-js": "~2.4" }, "devDependencies": { "async": "^1.4.2", - "aws-sdk": "~1.5.0", + "aws-sdk": "^2.1.49", "babel-loader": "^5.0.0", "babel-runtime": "^5.1.10", "benchmark": "~1.0", @@ -53,8 +53,8 @@ "jison": "~0.3.0", "mocha": "~1.20.0", "mock-stdin": "^0.3.0", - "mustache": "0.x", - "semver": "^4.0.0", + "mustache": "^2.1.3", + "semver": "^5.0.1", "underscore": "^1.5.1" }, "main": "lib/index.js", From 6e9198b20796437722a622f19a4d73ee57420582 Mon Sep 17 00:00:00 2001 From: kpdecker Date: Wed, 2 Sep 2015 20:42:23 -0500 Subject: [PATCH 04/10] Remove duplicated release notes --- release-notes.md | 43 ------------------------------------------- 1 file changed, 43 deletions(-) diff --git a/release-notes.md b/release-notes.md index dba8a55ec..2f0214025 100644 --- a/release-notes.md +++ b/release-notes.md @@ -45,49 +45,6 @@ Compatibility notes: - AST constructors have been dropped in favor of plain old javascript objects - The runtime version has been increased. Precompiled templates will need to use runtime of at least 4.0.0. -[Commits](https://github.com/wycats/handlebars.js/compare/v4.0.0...v4.0.0) - -## v4.0.0 - September 1st, 2015 -- [#1082](https://github.com/wycats/handlebars.js/pull/1082) - Decorators and Inline Partials ([@kpdecker](https://api.github.com/users/kpdecker)) -- [#1076](https://github.com/wycats/handlebars.js/pull/1076) - Implement partial blocks ([@kpdecker](https://api.github.com/users/kpdecker)) -- [#1087](https://github.com/wycats/handlebars.js/pull/1087) - Fix #each when last object entry has empty key ([@denniskuczynski](https://api.github.com/users/denniskuczynski)) -- [#1084](https://github.com/wycats/handlebars.js/pull/1084) - Bump uglify version to fix vulnerability ([@John-Steidley](https://api.github.com/users/John-Steidley)) -- [#1068](https://github.com/wycats/handlebars.js/pull/1068) - Fix typo ([@0xack13](https://api.github.com/users/0xack13)) -- [#1060](https://github.com/wycats/handlebars.js/pull/1060) - #1056 Fixed grammar for nested raw blocks ([@ericbn](https://api.github.com/users/ericbn)) -- [#1052](https://github.com/wycats/handlebars.js/pull/1052) - Updated year in License ([@maqnouch](https://api.github.com/users/maqnouch)) -- [#1037](https://github.com/wycats/handlebars.js/pull/1037) - Fix minor typos in README ([@tomxtobin](https://api.github.com/users/tomxtobin)) -- [#1032](https://github.com/wycats/handlebars.js/issues/1032) - Is it possible to render a partial without the parent scope? ([@aputinski](https://api.github.com/users/aputinski)) -- [#1019](https://github.com/wycats/handlebars.js/pull/1019) - Fixes typo in tests ([@aymerick](https://api.github.com/users/aymerick)) -- [#1016](https://github.com/wycats/handlebars.js/issues/1016) - Version mis-match ([@mayankdedhia](https://api.github.com/users/mayankdedhia)) -- [#1023](https://github.com/wycats/handlebars.js/issues/1023) - is it possible for nested custom helpers to communicate between each other? -- [#893](https://github.com/wycats/handlebars.js/issues/893) - [Proposal] Section blocks. -- [#792](https://github.com/wycats/handlebars.js/issues/792) - feature request: inline partial definitions -- [#583](https://github.com/wycats/handlebars.js/issues/583) - Parent path continues to drill down depth with multiple conditionals -- [#404](https://github.com/wycats/handlebars.js/issues/404) - Add named child helpers that can be referenced by block helpers -- Escape = in HTML content - [83b8e84](https://github.com/wycats/handlebars.js/commit/83b8e84) -- Drop AST constructors in favor of JSON - [95d84ba](https://github.com/wycats/handlebars.js/commit/95d84ba) -- Pass container rather than exec as context - [9a2d1d6](https://github.com/wycats/handlebars.js/commit/9a2d1d6) -- Add ignoreStandalone compiler option - [ea3a5a1](https://github.com/wycats/handlebars.js/commit/ea3a5a1) -- Ignore empty when iterating on sparse arrays - [06d515a](https://github.com/wycats/handlebars.js/commit/06d515a) -- Add support for string and stdin precompilation - [0de8dac](https://github.com/wycats/handlebars.js/commit/0de8dac) -- Simplify object assignment generation logic - [77e6bfc](https://github.com/wycats/handlebars.js/commit/77e6bfc) -- Bulletproof AST.helpers.helperExpression - [93b0760](https://github.com/wycats/handlebars.js/commit/93b0760) -- Always return string responses - [8e868ab](https://github.com/wycats/handlebars.js/commit/8e868ab) -- Pass undefined fields to helpers in strict mode - [5d4b8da](https://github.com/wycats/handlebars.js/commit/5d4b8da) -- Avoid depth creation when context remains the same - [279e038](https://github.com/wycats/handlebars.js/commit/279e038) -- Improve logging API - [9a49d35](https://github.com/wycats/handlebars.js/commit/9a49d35) -- Fix with operator in no @data mode - [231a8d7](https://github.com/wycats/handlebars.js/commit/231a8d7) -- Allow empty key name in each iteration - [1bb640b](https://github.com/wycats/handlebars.js/commit/1bb640b) -- Add with block parameter support - [2a85106](https://github.com/wycats/handlebars.js/commit/2a85106) -- Fix escaping of non-javascript identifiers - [410141c](https://github.com/wycats/handlebars.js/commit/410141c) -- Fix location information for programs - [93faffa](https://github.com/wycats/handlebars.js/commit/93faffa) - -Compatibility notes: -- Depthed paths are now conditional pushed on to the stack. If the helper uses the same context, then a new stack is not created. This leads to behavior the better matches expectations for helpers like `if` that do not seem to alter the context. Any instances of `../` in templates will need to be checked for the correct behavior under 4.0.0. In general templates will either reduce the number of `../` instances or leave them as is. See [#1028](https://github.com/wycats/handlebars.js/issues/1028). -- The `=` character is now HTML escaped. This closes a potential exploit case when using unquoted attributes, i.e. `
`. In general it's recommended that attributes always be quoted when their values are generated from a mustache to avoid any potential exploit surfaces. -- AST constructors have been dropped in favor of plain old javascript objects -- The runtime version has been increased. Precompiled templates will need to use runtime of at least 4.0.0. - [Commits](https://github.com/wycats/handlebars.js/compare/v3.0.3...v4.0.0) ## v3.0.3 - April 28th, 2015 From f71f4e759e7812979aa7ec058c4802c9a8c7235b Mon Sep 17 00:00:00 2001 From: kpdecker Date: Wed, 2 Sep 2015 20:42:49 -0500 Subject: [PATCH 05/10] Better assert message in shouldThrow --- spec/env/common.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/env/common.js b/spec/env/common.js index 111294c68..2a24db20f 100644 --- a/spec/env/common.js +++ b/spec/env/common.js @@ -66,7 +66,7 @@ global.shouldThrow = function(callback, type, msg) { throw new AssertError('Type failure: ' + err); } if (msg && !(msg.test ? msg.test(err.message) : msg === err.message)) { - equal(msg, err.message); + throw new AssertError('Throw mismatch: Expected ' + err.message + ' to match ' + msg + '\n\n' + err.stack, shouldThrow); } } if (failed) { From 05b82a203e729b5caa206aabfef5456d84e10746 Mon Sep 17 00:00:00 2001 From: kpdecker Date: Wed, 2 Sep 2015 20:43:54 -0500 Subject: [PATCH 06/10] Fix failure when using decorators in partials --- lib/handlebars/compiler/javascript-compiler.js | 1 + spec/regressions.js | 9 +++++++++ 2 files changed, 10 insertions(+) diff --git a/lib/handlebars/compiler/javascript-compiler.js b/lib/handlebars/compiler/javascript-compiler.js index ff583c794..d0f206c58 100644 --- a/lib/handlebars/compiler/javascript-compiler.js +++ b/lib/handlebars/compiler/javascript-compiler.js @@ -703,6 +703,7 @@ JavaScriptCompiler.prototype = { } options.helpers = 'helpers'; options.partials = 'partials'; + options.decorators = 'container.decorators'; if (!isDynamic) { params.unshift(this.nameLookup('partials', name, 'partial')); diff --git a/spec/regressions.js b/spec/regressions.js index 825ee35ac..ae0797e9a 100644 --- a/spec/regressions.js +++ b/spec/regressions.js @@ -203,4 +203,13 @@ describe('Regressions', function() { array[3] = 'bar'; shouldCompileTo('{{#each array}}{{@index}}{{.}}{{/each}}', {array: array}, '1foo3bar'); }); + + it('should support multiple levels of inline partials', function() { + var string = '{{#> layout}}{{#*inline "subcontent"}}subcontent{{/inline}}{{/layout}}'; + var partials = { + doctype: 'doctype{{> content}}', + layout: '{{#> doctype}}{{#*inline "content"}}layout{{> subcontent}}{{/inline}}{{/doctype}}' + }; + shouldCompileToWithPartials(string, [{}, {}, partials], true, 'doctypelayoutsubcontent'); + }); }); From 3934b3ab92db837a2825f115e389fb9d314a934e Mon Sep 17 00:00:00 2001 From: kpdecker Date: Wed, 2 Sep 2015 21:19:53 -0500 Subject: [PATCH 07/10] Remove duplicate dependency --- package.json | 1 - 1 file changed, 1 deletion(-) diff --git a/package.json b/package.json index 76f6552a1..0d429ea57 100644 --- a/package.json +++ b/package.json @@ -29,7 +29,6 @@ "uglify-js": "~2.4" }, "devDependencies": { - "async": "^1.4.2", "aws-sdk": "^2.1.49", "babel-loader": "^5.0.0", "babel-runtime": "^5.1.10", From 2d9a5151e837f00c7a61b822ce4f62a8eebe86e6 Mon Sep 17 00:00:00 2001 From: kpdecker Date: Wed, 2 Sep 2015 21:20:03 -0500 Subject: [PATCH 08/10] Add source map flag for istanbul fork --- tasks/test.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tasks/test.js b/tasks/test.js index 74473244a..7d6659b09 100644 --- a/tasks/test.js +++ b/tasks/test.js @@ -32,7 +32,7 @@ module.exports = function(grunt) { grunt.registerTask('test:cov', function() { var done = this.async(); - var runner = childProcess.fork('node_modules/.bin/istanbul', ['cover', '--', './spec/env/runner.js'], {stdio: 'inherit'}); + var runner = childProcess.fork('node_modules/.bin/istanbul', ['cover', '--source-map', '--', './spec/env/runner.js'], {stdio: 'inherit'}); runner.on('close', function(code) { if (code != 0) { grunt.fatal(code + ' tests failed'); From 9a27693fae56c20727ad9974f2a1b542c5728e07 Mon Sep 17 00:00:00 2001 From: kpdecker Date: Wed, 2 Sep 2015 21:21:06 -0500 Subject: [PATCH 09/10] Update release notes --- release-notes.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/release-notes.md b/release-notes.md index 2f0214025..ef55b63e8 100644 --- a/release-notes.md +++ b/release-notes.md @@ -2,7 +2,12 @@ ## Development -[Commits](https://github.com/wycats/handlebars.js/compare/v4.0.0...master) +[Commits](https://github.com/wycats/handlebars.js/compare/v4.0.1...master) + +## v4.0.1 - September 2nd, 2015 +- Fix failure when using decorators in partials - 05b82a2 + +[Commits](https://github.com/wycats/handlebars.js/compare/v4.0.0...v4.0.1) ## v4.0.0 - September 1st, 2015 - [#1082](https://github.com/wycats/handlebars.js/pull/1082) - Decorators and Inline Partials ([@kpdecker](https://api.github.com/users/kpdecker)) From c7b28a65dab1f1bb370f258fd65796d74c7b53cb Mon Sep 17 00:00:00 2001 From: kpdecker Date: Wed, 2 Sep 2015 21:21:36 -0500 Subject: [PATCH 10/10] v4.0.1 --- components/bower.json | 2 +- components/handlebars.js.nuspec | 2 +- lib/handlebars/base.js | 2 +- package.json | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/components/bower.json b/components/bower.json index fce893b41..cb17eb32d 100644 --- a/components/bower.json +++ b/components/bower.json @@ -1,6 +1,6 @@ { "name": "handlebars", - "version": "4.0.0", + "version": "4.0.1", "main": "handlebars.js", "license": "MIT", "dependencies": {} diff --git a/components/handlebars.js.nuspec b/components/handlebars.js.nuspec index b259400bd..ee1fce077 100644 --- a/components/handlebars.js.nuspec +++ b/components/handlebars.js.nuspec @@ -2,7 +2,7 @@ handlebars.js - 4.0.0 + 4.0.1 handlebars.js Authors https://github.com/wycats/handlebars.js/blob/master/LICENSE https://github.com/wycats/handlebars.js/ diff --git a/lib/handlebars/base.js b/lib/handlebars/base.js index e68031ee6..087874a5d 100644 --- a/lib/handlebars/base.js +++ b/lib/handlebars/base.js @@ -4,7 +4,7 @@ import {registerDefaultHelpers} from './helpers'; import {registerDefaultDecorators} from './decorators'; import logger from './logger'; -export const VERSION = '4.0.0'; +export const VERSION = '4.0.1'; export const COMPILER_REVISION = 7; export const REVISION_CHANGES = { diff --git a/package.json b/package.json index 0d429ea57..8752ea0e7 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "handlebars", "barename": "handlebars", - "version": "4.0.0", + "version": "4.0.1", "description": "Handlebars provides the power necessary to let you build semantic templates effectively with no frustration", "homepage": "http://www.handlebarsjs.com/", "keywords": [