[ospec] pinpoint the o.only() call site

This commit is contained in:
Pierre-Yves Gérardy 2018-05-21 01:17:15 +02:00 committed by Pierre-Yves Gérardy
parent 2794ceb76f
commit 010d8daae9
2 changed files with 7 additions and 1 deletions

View file

@ -3,6 +3,7 @@
## Upcoming...
<!-- Add new lines here. Version number will be decided later -->
- 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))

View file

@ -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) {