Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
F
Front-End
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abdullh.alsoleman
Front-End
Commits
46b1b677
Unverified
Commit
46b1b677
authored
Oct 29, 2020
by
Yegor
Committed by
GitHub
Oct 29, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix stack frame parser (#69253)
parent
e5c4c4b2
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
1 deletion
+21
-1
stack_frame.dart
packages/flutter/lib/src/foundation/stack_frame.dart
+3
-1
stack_frame_test.dart
packages/flutter/test/foundation/stack_frame_test.dart
+18
-0
No files found.
packages/flutter/lib/src/foundation/stack_frame.dart
View file @
46b1b677
...
...
@@ -211,7 +211,9 @@ class StackFrame {
String
className
=
''
;
String
method
=
match
.
group
(
2
)!.
replaceAll
(
'.<anonymous closure>'
,
''
);
if
(
method
.
startsWith
(
'new'
))
{
className
=
method
.
split
(
' '
)[
1
];
final
List
<
String
>
methodParts
=
method
.
split
(
' '
);
// Sometimes a web frame will only read "new" and have no class name.
className
=
methodParts
.
length
>
1
?
method
.
split
(
' '
)[
1
]
:
'<unknown>'
;
method
=
''
;
if
(
className
.
contains
(
'.'
))
{
final
List
<
String
>
parts
=
className
.
split
(
'.'
);
...
...
packages/flutter/test/foundation/stack_frame_test.dart
View file @
46b1b677
...
...
@@ -81,6 +81,24 @@ void main() {
expect
(
'
$e
'
,
contains
(
'Got a stack frame from package:stack_trace'
));
}
});
test
(
'Can parse web constructor invocation with unknown class name'
,
()
{
const
String
stackTraceLine
=
'#32 new (http://localhost:42191/dart-sdk/lib/async/stream_controller.dart:880:9)'
;
expect
(
StackFrame
.
fromStackTraceLine
(
stackTraceLine
),
const
StackFrame
(
number:
32
,
className:
'<unknown>'
,
method:
''
,
packageScheme:
'http'
,
package:
'<unknown>'
,
packagePath:
'dart-sdk/lib/async/stream_controller.dart'
,
line:
880
,
column:
9
,
source
:
stackTraceLine
,
),
);
});
}
const
String
stackString
=
'''
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment