From a1d864d4a770ee419d7ffeeb5e1976c1a18ec583 Mon Sep 17 00:00:00 2001 From: Nils Knappmeier Date: Tue, 4 Sep 2018 00:15:02 +0200 Subject: [PATCH 1/3] chore: bump various dependencies - grunt -> 1 - grunt-contrib-watch -> 1 - mocha -> 5 - in common.js: define "global" , see mochajs/mocha#1159 - in builtins.js: revert "console.log" to old value just after using the mock (in log-helper tests), because mocha calls "console.log" on failure, before "afterEach" --- package.json | 6 +++--- spec/builtins.js | 11 +++++++++-- spec/env/common.js | 2 ++ 3 files changed, 14 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index a83ec1f50..6a5d71a7b 100644 --- a/package.json +++ b/package.json @@ -35,7 +35,7 @@ "benchmark": "~1.0", "dustjs-linkedin": "^2.0.2", "eco": "~1.1.0-rc-3", - "grunt": "~0.4.1", + "grunt": "^1.0.3", "grunt-babel": "^5.0.0", "grunt-cli": "~0.1.10", "grunt-contrib-clean": "0.x", @@ -44,13 +44,13 @@ "grunt-contrib-copy": "0.x", "grunt-contrib-requirejs": "0.x", "grunt-contrib-uglify": "0.x", - "grunt-contrib-watch": "0.x", + "grunt-contrib-watch": "^1.1.0", "grunt-eslint": "^20.1.0", "grunt-saucelabs": "8.x", "grunt-webpack": "^1.0.8", "istanbul": "^0.3.0", "jison": "~0.3.0", - "mocha": "~1.20.0", + "mocha": "^5", "mock-stdin": "^0.3.0", "mustache": "^2.1.3", "semver": "^5.0.1", diff --git a/spec/builtins.js b/spec/builtins.js index dc1df0a3e..ce6d8f4e8 100644 --- a/spec/builtins.js +++ b/spec/builtins.js @@ -312,10 +312,14 @@ describe('builtin helpers', function() { console.info = function(info) { equals('whee', info); called = true; + console.info = $info; + console.log = $log; }; console.log = function(log) { equals('whee', log); called = true; + console.info = $info; + console.log = $log; }; shouldCompileTo(string, hash, ''); @@ -329,6 +333,7 @@ describe('builtin helpers', function() { console.error = function(log) { equals('whee', log); called = true; + console.error = $error; }; shouldCompileTo(string, [hash,,,, {level: '03'}], ''); @@ -343,6 +348,7 @@ describe('builtin helpers', function() { console.log = function(log) { equals('whee', log); called = true; + console.log = $log; }; shouldCompileTo(string, [hash,,,, {level: '03'}], ''); @@ -385,9 +391,9 @@ describe('builtin helpers', function() { var hash = { blah: 'whee' }; var called = false; - console.info = console.log = console.error = console.debug = function(log) { - equals('whee', log); + console.info = console.log = console.error = console.debug = function() { called = true; + console.info = console.log = console.error = console.debug = $log; }; shouldCompileTo(string, hash, ''); @@ -403,6 +409,7 @@ describe('builtin helpers', function() { equals('foo', log2); equals(1, log3); called = true; + console.log = $log; }; shouldCompileTo(string, hash, ''); diff --git a/spec/env/common.js b/spec/env/common.js index e37805261..14d302aa9 100644 --- a/spec/env/common.js +++ b/spec/env/common.js @@ -1,3 +1,5 @@ +var global = (function() { return this; }()); + var AssertError; if (Error.captureStackTrace) { AssertError = function AssertError(message, caller) { From 8359722e5d309e0139ed715e4dd918355e9ceaab Mon Sep 17 00:00:00 2001 From: Nils Knappmeier Date: Tue, 4 Sep 2018 00:16:01 +0200 Subject: [PATCH 2/3] style: omit linting error caused by removing "if" --- lib/handlebars/compiler/compiler.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/handlebars/compiler/compiler.js b/lib/handlebars/compiler/compiler.js index 4f6de492f..894f7a7c0 100644 --- a/lib/handlebars/compiler/compiler.js +++ b/lib/handlebars/compiler/compiler.js @@ -67,6 +67,9 @@ Compiler.prototype = { 'lookup': true }; if (knownHelpers) { + // the next line should use "Object.keys", but the code has been like this a long time and changing it, might + // cause backwards-compatibility issues... It's an old library... + // eslint-disable-next-line guard-for-in for (let name in knownHelpers) { this.options.knownHelpers[name] = knownHelpers[name]; } From 2145c149949b962bdc0c7cd7d783a33066c4ddb0 Mon Sep 17 00:00:00 2001 From: Nils Knappmeier Date: Tue, 4 Sep 2018 00:18:46 +0200 Subject: [PATCH 3/3] bump grunt-plugin-dependencies to 1.x versions --- package.json | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/package.json b/package.json index 6a5d71a7b..237a3d157 100644 --- a/package.json +++ b/package.json @@ -37,13 +37,13 @@ "eco": "~1.1.0-rc-3", "grunt": "^1.0.3", "grunt-babel": "^5.0.0", - "grunt-cli": "~0.1.10", - "grunt-contrib-clean": "0.x", - "grunt-contrib-concat": "0.x", - "grunt-contrib-connect": "0.x", - "grunt-contrib-copy": "0.x", - "grunt-contrib-requirejs": "0.x", - "grunt-contrib-uglify": "0.x", + "grunt-cli": "^1", + "grunt-contrib-clean": "^1", + "grunt-contrib-concat": "^1", + "grunt-contrib-connect": "^1", + "grunt-contrib-copy": "^1", + "grunt-contrib-requirejs": "^1", + "grunt-contrib-uglify": "^1", "grunt-contrib-watch": "^1.1.0", "grunt-eslint": "^20.1.0", "grunt-saucelabs": "8.x",