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
e7154bee
Unverified
Commit
e7154bee
authored
Apr 13, 2018
by
Hans Muller
Committed by
GitHub
Apr 13, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove the rest of the uses of Number.tryParse() (#16568)
parent
1c3f6a85
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
4 deletions
+8
-4
analyze-sample-code.dart
dev/bots/analyze-sample-code.dart
+4
-2
fuchsia_reload.dart
packages/flutter_tools/lib/src/commands/fuchsia_reload.dart
+2
-1
fuchsia_remote_connection.dart
...ote_debug_protocol/lib/src/fuchsia_remote_connection.dart
+2
-1
No files found.
dev/bots/analyze-sample-code.dart
View file @
e7154bee
...
...
@@ -238,11 +238,13 @@ dependencies:
throw
'failed to parse error message:
$error
'
;
}
final
String
column
=
error
.
substring
(
colon2
+
kColon
.
length
,
bullet2
);
final
int
lineNumber
=
int
.
tryParse
(
line
,
radix:
10
);
// ignore: deprecated_member_use
final
int
lineNumber
=
int
.
parse
(
line
,
radix:
10
,
onError:
(
String
source
)
=>
throw
'failed to parse error message:
$error
'
);
// ignore: deprecated_member_use
final
int
columnNumber
=
int
.
parse
(
column
,
radix:
10
,
onError:
(
String
source
)
=>
throw
'failed to parse error message:
$error
'
);
if
(
lineNumber
==
null
)
{
throw
'failed to parse error message:
$error
'
;
}
final
int
columnNumber
=
int
.
tryParse
(
column
,
radix:
10
);
if
(
columnNumber
==
null
)
{
throw
'failed to parse error message:
$error
'
;
}
...
...
packages/flutter_tools/lib/src/commands/fuchsia_reload.dart
View file @
e7154bee
...
...
@@ -384,7 +384,8 @@ class FuchsiaReloadCommand extends FlutterCommand {
final
int
lastSpace
=
trimmed
.
lastIndexOf
(
' '
);
final
String
lastWord
=
trimmed
.
substring
(
lastSpace
+
1
);
if
((
lastWord
!=
'.'
)
&&
(
lastWord
!=
'..'
))
{
final
int
value
=
int
.
tryParse
(
lastWord
);
// ignore: deprecated_member_use
final
int
value
=
int
.
parse
(
lastWord
,
onError:
(
_
)
=>
null
);
if
(
value
!=
null
)
ports
.
add
(
value
);
}
...
...
packages/fuchsia_remote_debug_protocol/lib/src/fuchsia_remote_connection.dart
View file @
e7154bee
...
...
@@ -197,7 +197,8 @@ class FuchsiaRemoteConnection {
final
int
lastSpace
=
trimmed
.
lastIndexOf
(
' '
);
final
String
lastWord
=
trimmed
.
substring
(
lastSpace
+
1
);
if
((
lastWord
!=
'.'
)
&&
(
lastWord
!=
'..'
))
{
final
int
value
=
int
.
tryParse
(
lastWord
);
// ignore: deprecated_member_use
final
int
value
=
int
.
parse
(
lastWord
,
onError:
(
_
)
=>
null
);
if
(
value
!=
null
)
{
ports
.
add
(
value
);
}
...
...
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