Closed
Bug 989417
Opened 9 years ago
Closed 9 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•9 years ago
|
||
Comment 2•9 years ago
|
||
I'd suggest giving async a try. Its pretty neat imho. It removes the need for extra indentation.
Assignee | ||
Comment 3•9 years ago
|
||
I actually like that.
Assignee | ||
Comment 4•9 years ago
|
||
Attachment #8398639 -
Attachment is obsolete: true
Attachment #8398639 -
Flags: review?(rcampbell)
Attachment #8398968 -
Flags: review?(rcampbell)
Comment 5•9 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•9 years ago
|
||
https://hg.mozilla.org/integration/fx-team/rev/b98c0f82c792
Whiteboard: [fixed-in-fx-team]
https://hg.mozilla.org/mozilla-central/rev/b98c0f82c792
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Whiteboard: [fixed-in-fx-team]
Target Milestone: --- → Firefox 31
Updated•5 years ago
|
Product: Firefox → DevTools
You need to log in
before you can comment on or make changes to this bug.
Description
•