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){
|
7:[function(req,module,exports){
|
||||||
(function(global){/*global window, global*/
|
[
|
||||||
var functions = [
|
"log", "info", "warn", "error", "time",
|
||||||
[log, "log"]
|
"timeEnd", "trace", "dir", "assert"
|
||||||
, [info, "info"]
|
].forEach(function(x) {
|
||||||
, [warn, "warn"]
|
exports[x] = nop;
|
||||||
, [error, "error"]
|
});
|
||||||
, [time, "time"]
|
|
||||||
, [timeEnd, "timeEnd"]
|
|
||||||
, [trace, "trace"]
|
|
||||||
, [dir, "dir"]
|
|
||||||
, [assert, "assert"]
|
|
||||||
]
|
|
||||||
|
|
||||||
for (var i = 0; i < functions.length; i++) {
|
function nop() {}
|
||||||
var tuple = functions[i]
|
|
||||||
var f = tuple[0]
|
|
||||||
var name = tuple[1]
|
|
||||||
|
|
||||||
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){
|
"jshint":[function(req,module,exports){
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue