Skip to content

Commit 800dc77

Browse files
Wietse Venemafacebook-github-bot
authored andcommitted
Fixes type definition of StackFrame
Summary: **Motivation** This PR fixes the flow type definition of StackFrame in parseErrorStack.js. The methodName was missing and the column could be `null`. We integrate with it in our codebase and we wanted to use `methodName`, but flow complained. Refer to this file for possible values: [github.com/errwischt/stacktrace-parser/blob/master/lib/stacktrace-parser.js](https://github.com/errwischt/stacktrace-parser/blob/master/lib/stacktrace-parser.js) This also allowed me to remove a flow error suppression. **Test plan (required)** I ran flow on the project, no errors Closes facebook#12499 Differential Revision: D4619885 Pulled By: ericvicenti fbshipit-source-id: 0bf5a2304cb0dc9f2c6df026a5cee71c8a419c01
1 parent 27928f3 commit 800dc77

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

Libraries/Core/Devtools/parseErrorStack.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,10 @@
1212
'use strict';
1313

1414
export type StackFrame = {
15+
column: ?number,
1516
file: string,
1617
lineNumber: number,
17-
column: number,
18+
methodName: string,
1819
};
1920

2021
var stacktraceParser = require('stacktrace-parser');

Libraries/Core/Timers/JSTimers.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,6 @@ function _allocateCallback(func: Function, type: JSTimerType): number {
4040
e.framesToPop = 1;
4141
const stack = parseErrorStack(e);
4242
if (stack) {
43-
/* $FlowFixMe(>=0.32.0) - this seems to be putting something of the wrong
44-
* type into identifiers */
4543
JSTimersExecution.identifiers[freeIndex] = stack.shift();
4644
}
4745
}

0 commit comments

Comments
 (0)