[ospec] pinpoint the o.only() call site
This commit is contained in:
parent
2794ceb76f
commit
010d8daae9
2 changed files with 7 additions and 1 deletions
|
|
@ -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))
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue