@@ -168,6 +168,40 @@ describe('ErrorStackParser', () => {
168
168
} ) ;
169
169
} ) ;
170
170
171
+ it ( 'allows frames with parens in function names' , ( ) => {
172
+ const frames = parseErrorStack ( `Error Component Stack:
173
+ at FlatList (http://example.com/a.js:6:3)
174
+ at Animated(FlatList) (http://example.com/b.js:43:14)
175
+ at RNTesterApp(RootComponent) (http://example.com/c.js:29:11)` ) ;
176
+
177
+ assertNotNullOrUndefined ( frames ) ;
178
+ assert . lengthOf ( frames , 4 ) ;
179
+ assert . deepStrictEqual ( frames [ 1 ] . link , {
180
+ url : 'http://example.com/a.js' as Platform . DevToolsPath . UrlString ,
181
+ prefix : ' at FlatList (' ,
182
+ suffix : ')' ,
183
+ lineNumber : 5 , // 0-based.
184
+ columnNumber : 2 , // 0-based.
185
+ enclosedInBraces : true ,
186
+ } ) ;
187
+ assert . deepStrictEqual ( frames [ 2 ] . link , {
188
+ url : 'http://example.com/b.js' as Platform . DevToolsPath . UrlString ,
189
+ prefix : ' at Animated(FlatList) (' ,
190
+ suffix : ')' ,
191
+ lineNumber : 42 , // 0-based.
192
+ columnNumber : 13 , // 0-based.
193
+ enclosedInBraces : true ,
194
+ } ) ;
195
+ assert . deepStrictEqual ( frames [ 3 ] . link , {
196
+ url : 'http://example.com/c.js' as Platform . DevToolsPath . UrlString ,
197
+ prefix : ' at RNTesterApp(RootComponent) (' ,
198
+ suffix : ')' ,
199
+ lineNumber : 28 , // 0-based.
200
+ columnNumber : 10 , // 0-based.
201
+ enclosedInBraces : true ,
202
+ } ) ;
203
+ } ) ;
204
+
171
205
it ( 'correctly handles eval frames' , ( ) => {
172
206
const url = 'http://www.chromium.org/foo.js' as Platform . DevToolsPath . UrlString ;
173
207
const frames = parseErrorStack ( `Error: MyError
0 commit comments