tweak jshint console mock
This commit is contained in:
parent
62e7073b33
commit
cacd51e2fe
1 changed files with 7 additions and 42 deletions
|
|
@ -1075,50 +1075,15 @@ exports.register = function (linter) {
|
|||
},
|
||||
{}],
|
||||
7:[function(req,module,exports){
|
||||
(function(global){/*global window, global*/
|
||||
var functions = [
|
||||
[log, "log"]
|
||||
, [info, "info"]
|
||||
, [warn, "warn"]
|
||||
, [error, "error"]
|
||||
, [time, "time"]
|
||||
, [timeEnd, "timeEnd"]
|
||||
, [trace, "trace"]
|
||||
, [dir, "dir"]
|
||||
, [assert, "assert"]
|
||||
]
|
||||
[
|
||||
"log", "info", "warn", "error", "time",
|
||||
"timeEnd", "trace", "dir", "assert"
|
||||
].forEach(function(x) {
|
||||
exports[x] = nop;
|
||||
});
|
||||
|
||||
for (var i = 0; i < functions.length; i++) {
|
||||
var tuple = functions[i]
|
||||
var f = tuple[0]
|
||||
var name = tuple[1]
|
||||
function nop() {}
|
||||
|
||||
if (!console[name]) {
|
||||
console[name] = f
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = console
|
||||
|
||||
function log() {}
|
||||
|
||||
function info() {}
|
||||
|
||||
function warn() {}
|
||||
|
||||
function error() {}
|
||||
|
||||
function time(label) {}
|
||||
|
||||
function timeEnd(label) {}
|
||||
|
||||
function trace() {}
|
||||
|
||||
function dir(object) {}
|
||||
|
||||
function assert(expression) {}
|
||||
|
||||
})(window)
|
||||
},
|
||||
{}],
|
||||
"jshint":[function(req,module,exports){
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue