[ospec] cleanup o.only

This commit is contained in:
Pierre-Yves Gérardy 2018-05-26 00:48:44 +02:00 committed by Pierre-Yves Gérardy
parent f6e23da56c
commit e473536866

View file

@ -32,12 +32,11 @@ else window.o = m()
ctx = parent
}
o.only = function(subject, predicate, silent) {
if (!silent) {
console.log(highlight("/!\\ WARNING /!\\ o.only() mode"))
try {throw new Error} catch (e) {
console.log(o.cleanStackTrace(e) + "\n")
}
}
if (!silent) console.log(
highlight("/!\\ WARNING /!\\ o.only() mode") + "\n" + o.cleanStackTrace(ensureStackTrace(new Error)) + "\n",
cStyle("red"), ""
)
o(subject, only = predicate)
}
o.spy = function(fn) {