Closed
Bug 1133185
Opened 9 years ago
Closed 9 years ago
Remove nonstandard let blocks from toolkit/webapps
Categories
(Firefox Graveyard :: Web Apps, defect)
Tracking
(firefox39 fixed)
RESOLVED
FIXED
Firefox 39
Tracking | Status | |
---|---|---|
firefox39 | --- | fixed |
People
(Reporter: cpeterson, Assigned: cpeterson)
References
Details
Attachments
(1 file)
10.16 KB,
patch
|
myk
:
review+
|
Details | Diff | Splinter Review |
let blocks are a nonstandard SpiderMonkey feature we would like to remove (in bug 1023609).
Attachment #8564495 -
Flags: review?(myk)
Comment 1•9 years ago
|
||
Comment on attachment 8564495 [details] [diff] [review] remove-let-blocks.patch Review of attachment 8564495 [details] [diff] [review]: ----------------------------------------------------------------- This is ok, but we used some of these blocks to limit the scope of same-named variables, and I would prefer to avoid mixing declaration/assignments with non-declaration/assignments of such variables, so I would replace the blocks that enclose them with non-let blocks, f.e.: { let deferred = Promise.defer(); request.onerror = function() { deferred.reject(this.error.name); }; request.onsuccess = deferred.resolve; yield deferred.promise; } let appObject = request.result; ok(appObject, "app is non-null"); { let deferred = Promise.defer(); appObject.ondownloaderror = function() { deferred.reject(appObject.downloadError.name); }; appObject.ondownloadapplied = deferred.resolve; yield deferred.promise; } (Alternately, you could give them unique names or declare them separately.)
Attachment #8564495 -
Flags: review?(myk) → review+
Assignee | ||
Comment 2•9 years ago
|
||
Do you prefer the non-let blocks or unique names (like `deferred2`)? The non-let blocks would preserve the existing code indentation and variable names. The unique names are less ambiguous, but a little ugly.
Flags: needinfo?(myk)
Comment 3•9 years ago
|
||
(In reply to Chris Peterson [:cpeterson] from comment #2) > Do you prefer the non-let blocks or unique names (like `deferred2`)? The > non-let blocks would preserve the existing code indentation and variable > names. The unique names are less ambiguous, but a little ugly. I'm ok with either, but I would prefer the non-let blocks.
Flags: needinfo?(myk)
Assignee | ||
Comment 4•9 years ago
|
||
Thanks. I landed with the non-let blocks you suggested: https://hg.mozilla.org/integration/mozilla-inbound/rev/a179c7531bca
Comment 5•9 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/a179c7531bca
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
status-firefox39:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → Firefox 39
Updated•8 years ago
|
Product: Firefox → Firefox Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•