Skip to content
This repository was archived by the owner on Jun 26, 2022. It is now read-only.

Commit 99278f2

Browse files
committed
Merge pull request #24 from zxqfox/patch-1
Size optimizations
2 parents f88c690 + 31da49c commit 99278f2

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

index.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,12 @@
66
global.console = global.console || {};
77
var con = global.console;
88
var prop, method;
9-
var empty = {};
109
var dummy = function() {};
11-
var properties = 'memory'.split(',');
10+
var properties = ['memory'];
1211
var methods = ('assert,clear,count,debug,dir,dirxml,error,exception,group,' +
1312
'groupCollapsed,groupEnd,info,log,markTimeline,profile,profiles,profileEnd,' +
1413
'show,table,time,timeEnd,timeline,timelineEnd,timeStamp,trace,warn').split(',');
15-
while (prop = properties.pop()) if (!con[prop]) con[prop] = empty;
14+
while (prop = properties.pop()) if (!con[prop]) con[prop] = {};
1615
while (method = methods.pop()) if (typeof con[method] !== 'function') con[method] = dummy;
1716
// Using `this` for web workers & supports Browserify / Webpack.
1817
})(typeof window === 'undefined' ? this : window);

0 commit comments

Comments
 (0)