From 562d68098194d61668eb71fafd790a138eace0a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pierre-Yves=20G=C3=A9rardy?= Date: Thu, 24 May 2018 18:32:37 +0200 Subject: [PATCH] [ospec/bin] Back to ES5 (and complimentary cleanup), fix #2160 --- ospec/bin/ospec | 41 ++++++++++++++++++----------------------- ospec/change-log.md | 7 ++++++- 2 files changed, 24 insertions(+), 24 deletions(-) diff --git a/ospec/bin/ospec b/ospec/bin/ospec index a0f56f57..5019f1d2 100755 --- a/ospec/bin/ospec +++ b/ospec/bin/ospec @@ -1,16 +1,16 @@ #!/usr/bin/env node "use strict" -const o = require("../ospec") -const path = require("path") -const glob = require("glob") +var o = require("../ospec") +var path = require("path") +var glob = require("glob") -const parseArgs = (argv) => { +function parseArgs(argv) { argv = ["--globs"].concat(argv.slice(2)) - const args = {} - let name - argv.forEach((arg) => { + var args = {} + var name + argv.forEach(function(arg) { if (/^--/.test(arg)) { name = arg.substr(2) args[name] = args[name] || [] @@ -22,26 +22,21 @@ const parseArgs = (argv) => { } -const args = parseArgs(process.argv) -const globList = args.globs && args.globs.length ? args.globs : ["**/tests/**/*.js"] -const ignore = ["**/node_modules/**"].concat(args.ignore||[]) -const cwd = process.cwd() +var args = parseArgs(process.argv) +var globList = args.globs && args.globs.length ? args.globs : ["**/tests/**/*.js"] +var ignore = ["**/node_modules/**"].concat(args.ignore||[]) +var cwd = process.cwd() args.require && args.require.forEach(function(module) { module && require(require.resolve(module, { basedir: cwd })) }) -let pending = globList.length -globList.forEach((globPattern) => { - glob(globPattern, {ignore}) - .on("match", (fileName) => { require(path.join(cwd, fileName)) }) // eslint-disable-line global-require - .on("error", (e) => console.error(e)) - .on("end", () => { - pending-- - if (pending === 0) { - o.run() - } - }) +var pending = globList.length +globList.forEach(function(globPattern) { + glob(globPattern, {ignore: ignore}) + .on("match", function(fileName) { require(path.join(cwd, fileName)) }) // eslint-disable-line global-require + .on("error", function(e) { console.error(e) }) + .on("end", function() { if (--pending === 0) o.run()}) }); -process.on("unhandledRejection", (e) => { console.log("Uncaught (in promise) " + e.stack) }) +process.on("unhandledRejection", function(e) { console.error("Uncaught (in promise) " + e.stack) }) diff --git a/ospec/change-log.md b/ospec/change-log.md index e037091c..5bd028e5 100644 --- a/ospec/change-log.md +++ b/ospec/change-log.md @@ -3,9 +3,14 @@ ## Upcoming... -- Pinpoint the `o.only()` call site +### Features +>>>>>>> [ospec/bin] Back to ES5 (and complimentary cleanup), fix #2160 +- Pinpoint the `o.only()` call site ([#2157](https://github.com/MithrilJS/mithril.js/pull/2157)) - Improved wording, spacing and color-coding of report messages and errors ([#2147](https://github.com/MithrilJS/mithril.js/pull/2147), [@maranomynet](https://github.com/maranomynet)) +### Bug fixes +- Convert the exectuable back to plain ES5 [#2160](https://github.com/MithrilJS/mithril.js/issues/2160) ([#2161](https://github.com/MithrilJS/mithril.js/pull/2161)) + ## 2.0.0 _2018-05-09_