Closed
Bug 989417
Opened 11 years ago
Closed 11 years ago
Use Task.spawn in Netmonitor code to improve code readability
Categories
(DevTools :: Netmonitor, defect)
DevTools
Netmonitor
Tracking
(Not tracked)
RESOLVED
FIXED
Firefox 31
People
(Reporter: vporof, Assigned: vporof)
Details
Attachments
(1 file, 1 obsolete file)
35.05 KB,
patch
|
rcampbell
:
review+
|
Details | Diff | Splinter Review |
There are a few places in the netmonitor code that would benefit from using Task instead of awkwardly and sequentially then-ing.
Assignee | ||
Comment 1•11 years ago
|
||
Comment 2•11 years ago
|
||
I'd suggest giving async a try. Its pretty neat imho. It removes the need for extra indentation.
Assignee | ||
Comment 3•11 years ago
|
||
I actually like that.
Assignee | ||
Comment 4•11 years ago
|
||
Attachment #8398639 -
Attachment is obsolete: true
Attachment #8398639 -
Flags: review?(rcampbell)
Attachment #8398968 -
Flags: review?(rcampbell)
Comment 5•11 years ago
|
||
Comment on attachment 8398968 [details] [diff] [review]
v2
Review of attachment 8398968 [details] [diff] [review]:
-----------------------------------------------------------------
::: browser/devtools/netmonitor/netmonitor-view.js
@@ +1217,5 @@
> * The type of information that is to be updated.
> * @param any aValue
> * The new value to be shown.
> + * @return object
> + * A promise that is resolved once the information is displayed.
is this true? I don't see a return anywhere in here.
@@ +1779,5 @@
> * The data source (this should be the attachment of a request item).
> * @return object
> * Returns a promise that resolves upon population of the subview.
> */
> + populate: Task.async(function*(aData) {
aren't you just on the cutting edge?
@@ +2260,5 @@
> * The "requestPostData" message received from the server.
> * @return object
> * A promise that is resolved when the request post params are set.
> */
> + _setRequestPostParams: Task.async(function*(aHeadersResponse, aHeadersFromUploadStream, aPostDataResponse) {
long line is long.
@@ +2269,3 @@
> let { headers: requestHeaders } = aHeadersResponse;
> let { headers: payloadHeaders } = aHeadersFromUploadStream;
> let allHeaders = [...payloadHeaders, ...requestHeaders];
if you use every language feature in one function do you win a prize?
@@ +2269,5 @@
> let { headers: requestHeaders } = aHeadersResponse;
> let { headers: payloadHeaders } = aHeadersFromUploadStream;
> let allHeaders = [...payloadHeaders, ...requestHeaders];
>
> + let contentTypeHeader = allHeaders.find(e => e.name.toLowerCase() == "content-type");
<b>This is an experimental technology, part of the Harmony (ECMAScript 6) proposal.</b>
THANKS FOR MAKING ME LEARN STUFF, jerkface.
Attachment #8398968 -
Flags: review?(rcampbell) → review+
Assignee | ||
Comment 6•11 years ago
|
||
Whiteboard: [fixed-in-fx-team]
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Whiteboard: [fixed-in-fx-team]
Target Milestone: --- → Firefox 31
Updated•6 years ago
|
Product: Firefox → DevTools
You need to log in
before you can comment on or make changes to this bug.
Description
•