Skip to content
This repository has been archived by the owner on Feb 19, 2022. It is now read-only.

Commit

Permalink
Try different bind arrangement.
Browse files Browse the repository at this point in the history
  • Loading branch information
ryan-roemer committed Feb 28, 2015
1 parent a363055 commit 2c4b989
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion simple-console.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,15 @@
if (noConsole || !con[meth]) {
// No console or method: Noop it.
self[meth] = NOOP;
} else if (con[meth].bind) {
// Try to use built-in bind first, where possible.
// (Hopefully) fixes Safari on Mac OS X 10.9 on Sauce.
// See: https://saucelabs.com/tests/9a89e381c91c4e43b25ab8ee16a514e1
self[meth] = con[meth].bind(con);
} else if (bind) {
// IE9 and most others: Bind to our create real function.
// Should work if `console.FOO` is `function` or `object`.
self[meth] = bind.call(con[meth], con);
self[meth] = bind(con[meth], con);
} else {
// IE8: No bind, so even more tortured.
self[meth] = function () {
Expand Down

0 comments on commit 2c4b989

Please sign in to comment.