mirror of
https://github.com/niklasvh/html2canvas.git
synced 2023-08-10 21:13:10 +03:00
Check availability of console before using it (Fix IE9)
This commit is contained in:
parent
68900c3087
commit
216c290c4b
@ -10,6 +10,7 @@ export default class Logger {
|
|||||||
|
|
||||||
// eslint-disable-next-line flowtype/no-weak-types
|
// eslint-disable-next-line flowtype/no-weak-types
|
||||||
log(...args: any) {
|
log(...args: any) {
|
||||||
|
if (window.console && window.console.log) {
|
||||||
Function.prototype.bind
|
Function.prototype.bind
|
||||||
.call(window.console.log, window.console)
|
.call(window.console.log, window.console)
|
||||||
.apply(
|
.apply(
|
||||||
@ -17,9 +18,11 @@ export default class Logger {
|
|||||||
[Date.now() - this.start + 'ms', 'html2canvas:'].concat([].slice.call(args, 0))
|
[Date.now() - this.start + 'ms', 'html2canvas:'].concat([].slice.call(args, 0))
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// eslint-disable-next-line flowtype/no-weak-types
|
// eslint-disable-next-line flowtype/no-weak-types
|
||||||
error(...args: any) {
|
error(...args: any) {
|
||||||
|
if (window.console && window.console.error) {
|
||||||
Function.prototype.bind
|
Function.prototype.bind
|
||||||
.call(window.console.error, window.console)
|
.call(window.console.error, window.console)
|
||||||
.apply(
|
.apply(
|
||||||
@ -27,4 +30,5 @@ export default class Logger {
|
|||||||
[Date.now() - this.start + 'ms', 'html2canvas:'].concat([].slice.call(args, 0))
|
[Date.now() - this.start + 'ms', 'html2canvas:'].concat([].slice.call(args, 0))
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user