From 010d8daae9719a034d768664ee3a0a4f451f2304 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pierre-Yves=20G=C3=A9rardy?= Date: Mon, 21 May 2018 01:17:15 +0200 Subject: [PATCH] [ospec] pinpoint the o.only() call site --- ospec/change-log.md | 1 + ospec/ospec.js | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/ospec/change-log.md b/ospec/change-log.md index bb7102a6..e037091c 100644 --- a/ospec/change-log.md +++ b/ospec/change-log.md @@ -3,6 +3,7 @@ ## Upcoming... +- Pinpoint the `o.only()` call site - 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)) diff --git a/ospec/ospec.js b/ospec/ospec.js index 5674b499..526a088e 100644 --- a/ospec/ospec.js +++ b/ospec/ospec.js @@ -34,7 +34,12 @@ else window.o = m() ctx = parent } o.only = function(subject, predicate, silent) { - if (!silent) console.log(highlight("/!\\ WARNING /!\\ o.only() mode")) + if (!silent) { + console.log(highlight("/!\\ WARNING /!\\ o.only() mode")) + try {throw new Error} catch (e) { + console.log(this.cleanStackTrace(e) + "\n") + } + } o(subject, only = predicate) } o.spy = function(fn) {