Skip to content

Commit

Permalink
Pass through console methods that we don't intercept
Browse files Browse the repository at this point in the history
  • Loading branch information
longouyang committed Sep 21, 2016
1 parent 19a47bf commit 373da81
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -366,6 +366,14 @@ var CodeEditor = React.createClass({
}
};

// pass through un-intercepted console methods
_.each(_.difference(_.methods(nativeConsole),
_.methods(global['console'])),
function(key) {
global['console'][key] = nativeConsole[key]
}
)

// inject this component's side effect methods into global
var sideEffectMethods = ['print'];
_.each(sideEffectMethods,
Expand Down

0 comments on commit 373da81

Please sign in to comment.