Skip to content

Commit

Permalink
Don't collect warnings if yellow box is disabled
Browse files Browse the repository at this point in the history
Reviewed By: vjeux

Differential Revision: D3641566

fbshipit-source-id: 1e2279be1656a305af8b4c5eaf32789a5ba6577d
  • Loading branch information
davidaurelio authored and Facebook Github Bot 4 committed Jul 29, 2016
1 parent cc05a71 commit 654a360
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions Libraries/ReactIOS/YellowBox.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ import type EmitterSubscription from 'EmitterSubscription';
import type {StackFrame} from 'parseErrorStack';

type WarningInfo = {
count: number;
stacktrace: Array<StackFrame>;
symbolicated: boolean;
count: number,
stacktrace: Array<StackFrame>,
symbolicated: boolean,
};

const _warningEmitter = new EventEmitter();
Expand Down Expand Up @@ -85,6 +85,9 @@ function sprintf(format, ...args) {
}

function updateWarningMap(format, ...args): void {
if (console.disableYellowBox) {
return;
}
const stringifySafe = require('stringifySafe');

format = String(format);
Expand Down Expand Up @@ -268,9 +271,9 @@ const WarningInspector = ({

class YellowBox extends React.Component {
state: {
stacktraceVisible: boolean;
inspecting: ?string;
warningMap: Map<any, any>;
stacktraceVisible: boolean,
inspecting: ?string,
warningMap: Map<any, any>,
};
_listener: ?EmitterSubscription;
dismissWarning: (warning: ?string) => void;
Expand Down

0 comments on commit 654a360

Please sign in to comment.