Add console.log protection to TrivialReporter.js
This commit is contained in:
parent
275b83cc52
commit
3ccb2e6e8d
@ -59,3 +59,13 @@ jasmine.TrivialReporter.prototype.reportSpecResults = function(spec) {
|
||||
jasmine.TrivialReporter.prototype.log = function() {
|
||||
console.log.apply(console, arguments);
|
||||
};
|
||||
|
||||
//protect against console.log incidents
|
||||
if (!("console" in window) || !("firebug" in console)) {
|
||||
var names = ["log", "debug", "info", "warn", "error", "assert", "dir", "dirxml", "group", "groupEnd", "time", "timeEnd", "count", "trace", "profile", "profileEnd"];
|
||||
window.console = {};
|
||||
for (var i = 0, len = names.length; i < len; ++i) {
|
||||
window.console[names[i]] = function() {
|
||||
};
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user