Make ospec work natively in browser environments

This commit is contained in:
Pierre-Yves Gérardy 2017-11-29 21:46:26 +01:00
parent 567ebb8b9f
commit af35e4b446

View file

@ -1,7 +1,9 @@
/* eslint-disable global-require, no-bitwise, no-process-exit */ /* eslint-disable global-require, no-bitwise, no-process-exit */
"use strict" "use strict"
;(function(m) {
module.exports = new function init(name) { if (typeof module !== "undefined") module["exports"] = m()
else window.o = m()
})(function init(name) {
var spec = {}, subjects = [], results, only = null, ctx = spec, start, stack = 0, nextTickish, hasProcess = typeof process === "object", reporter, hasOwn = ({}).hasOwnProperty var spec = {}, subjects = [], results, only = null, ctx = spec, start, stack = 0, nextTickish, hasProcess = typeof process === "object", reporter, hasOwn = ({}).hasOwnProperty
if (name != null) spec[name] = ctx = {} if (name != null) spec[name] = ctx = {}
@ -265,4 +267,4 @@ module.exports = new function init(name) {
} }
return o return o
} })