From 800dc771724f2d392c87d7c49f5fcea96d41dd2c Mon Sep 17 00:00:00 2001 From: Wietse Venema Date: Mon, 27 Feb 2017 02:33:49 -0800 Subject: [PATCH] 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 https://github.com/facebook/react-native/pull/12499 Differential Revision: D4619885 Pulled By: ericvicenti fbshipit-source-id: 0bf5a2304cb0dc9f2c6df026a5cee71c8a419c01 --- Libraries/Core/Devtools/parseErrorStack.js | 3 ++- Libraries/Core/Timers/JSTimers.js | 2 -- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/Libraries/Core/Devtools/parseErrorStack.js b/Libraries/Core/Devtools/parseErrorStack.js index 573fbd1449d..bd2ef9a9d85 100644 --- a/Libraries/Core/Devtools/parseErrorStack.js +++ b/Libraries/Core/Devtools/parseErrorStack.js @@ -12,9 +12,10 @@ 'use strict'; export type StackFrame = { + column: ?number, file: string, lineNumber: number, - column: number, + methodName: string, }; var stacktraceParser = require('stacktrace-parser'); diff --git a/Libraries/Core/Timers/JSTimers.js b/Libraries/Core/Timers/JSTimers.js index c89a6695b2a..842b47ba545 100644 --- a/Libraries/Core/Timers/JSTimers.js +++ b/Libraries/Core/Timers/JSTimers.js @@ -40,8 +40,6 @@ function _allocateCallback(func: Function, type: JSTimerType): number { e.framesToPop = 1; const stack = parseErrorStack(e); if (stack) { - /* $FlowFixMe(>=0.32.0) - this seems to be putting something of the wrong - * type into identifiers */ JSTimersExecution.identifiers[freeIndex] = stack.shift(); } }