File tree Expand file tree Collapse file tree 1 file changed +7
-19
lines changed Expand file tree Collapse file tree 1 file changed +7
-19
lines changed Original file line number Diff line number Diff line change @@ -312,24 +312,12 @@ cc._initDebugSetting = function (mode) {
312
312
} else if ( console && console . log . apply ) { //console is null when user doesn't open dev tool on IE9
313
313
//log to console
314
314
315
- cc . error = function ( ) {
316
- return console . error . apply ( console , arguments ) ;
317
- } ;
318
- cc . assert = function ( cond , msg ) {
319
- if ( ! cond && msg ) {
320
- for ( var i = 2 ; i < arguments . length ; i ++ )
321
- msg = msg . replace ( / ( % s ) | ( % d ) / , cc . _formatString ( arguments [ i ] ) ) ;
322
- throw new Error ( msg ) ;
323
- }
324
- } ;
325
- if ( mode !== ccGame . DEBUG_MODE_ERROR )
326
- cc . warn = function ( ) {
327
- return console . warn . apply ( console , arguments ) ;
328
- } ;
329
- if ( mode === ccGame . DEBUG_MODE_INFO )
330
- cc . log = function ( ) {
331
- return console . log . apply ( console , arguments ) ;
332
- } ;
315
+ cc . error = Function . prototype . bind . call ( console . error , console ) ;
316
+ cc . assert = Function . prototype . bind . call ( console . assert , console ) ;
317
+ if ( mode !== ccGame . DEBUG_MODE_ERROR )
318
+ cc . warn = Function . prototype . bind . call ( console . warn , console ) ;
319
+ if ( mode === ccGame . DEBUG_MODE_INFO )
320
+ cc . log = Function . prototype . bind . call ( console . log , console ) ;
333
321
}
334
322
} ;
335
- //+++++++++++++++++++++++++something about log end+++++++++++++++++++++++++++++
323
+ //+++++++++++++++++++++++++something about log end+++++++++++++++++++++++++++++
You can’t perform that action at this time.
0 commit comments