import { console } from "./globals";

/**
 * Returns a function that proxies to the given method name on the globals
 * console object. The proxy will also detect if the console doesn't exist and
 * will appropriately no-op. This allows support for IE9, which doesn't have a
 * console if the developer tools are not open.
 */
function consoleProxy( method ) {
	return function( ...args ) {
		if ( console ) {
			console[ method ]( ...args );
		}
	};
}

export default {
	warn: consoleProxy( "warn" )
};

@@ -36,126 +36,11 @@
 ;%0A%0A/
-**%0A * Returns a function that proxies to the given method name on the globals%0A * console object. The proxy will also d
+/ D
 etec
@@ -77,37 +77,31 @@
  and
-%0A * will appropriately no-op.
+ no-op in that case.%0A//
  Thi
@@ -123,16 +123,17 @@
 t for IE
+ 
 9, which
@@ -151,19 +151,16 @@
 ve a
-%0A *
  console
  if 
@@ -155,16 +155,26 @@
  console
+%0A// object
  if the 
@@ -207,185 +207,87 @@
 en.%0A
- */%0Afunction consoleProxy( method ) %7B%0A%09return function( ...args ) %7B%0A%09%09if ( console ) %7B%0A%09%09%09console%5B method %5D( ...args );%0A%09%09%7D%0A%09%7D;%0A%7D%0A%0Aexport default %7B%0A%09warn: consoleProxy( %22warn%22 )
+%0Aexport default %7B%0A%09warn: console ? console.warn.bind( console ) : function() %7B%7D
 %0A%7D;%0A

Simplify Logger.warn() internals