RN: Clear Debug Console on Reload JS

Summary:
Clears the debug console whenever the React Native JS is reloaded.

NOTE: This respects "Preserve log" in Chrome by default.

Reviewed By: jingc

Differential Revision: D3409713

fbshipit-source-id: ce215e3125cf43ab3ea5811c707fab9dfa4bcbb3
This commit is contained in:
Tim Yung 2016-06-08 19:00:12 -07:00 committed by Facebook Github Bot 9
parent 67002e8ae3
commit b03a725447
1 changed files with 1 additions and 0 deletions

View File

@ -72,6 +72,7 @@ function connectToDebuggerProxy() {
// Special message that asks for a new JS runtime // Special message that asks for a new JS runtime
if (object.method === 'prepareJSRuntime') { if (object.method === 'prepareJSRuntime') {
shutdownJSRuntime(); shutdownJSRuntime();
console.clear();
createJSRuntime(); createJSRuntime();
ws.send(JSON.stringify({replyID: object.id})); ws.send(JSON.stringify({replyID: object.id}));
setStatus('Debugger session #' + object.id + ' active.'); setStatus('Debugger session #' + object.id + ' active.');