Bug 1176411 - Stop parenthesizing array/object pattern destructuring assignment targets in addon SDK code. r=jsantell, a=KWierso

This commit is contained in:
Jeff Walden 2015-06-19 16:22:19 -07:00
parent 397401aa7f
commit 00bc69624f
3 changed files with 7 additions and 7 deletions

View File

@ -247,11 +247,11 @@ Object.defineProperties(Buffer.prototype, {
value: function(string, offset, length, encoding = 'utf8') {
// write(string, encoding);
if (typeof(offset) === 'string' && Number.isNaN(parseInt(offset))) {
([offset, length, encoding]) = [0, null, offset];
[offset, length, encoding] = [0, null, offset];
}
// write(string, offset, encoding);
else if (typeof(length) === 'string')
([length, encoding]) = [null, length];
[length, encoding] = [null, length];
if (offset < 0 || offset > this.length)
throw new RangeError('offset is outside of valid range');

View File

@ -129,7 +129,7 @@ function display(panel, options, anchor) {
let viewportRect = document.defaultView.gBrowser.getBoundingClientRect();
({x, y, width, height}) = calculateRegion(options, viewportRect);
({x, y, width, height} = calculateRegion(options, viewportRect));
}
else {
// The XUL Panel has an arrow, so the margin needs to be reset
@ -145,7 +145,7 @@ function display(panel, options, anchor) {
// chrome browser window, and therefore there is no need for this check.
if (CustomizableUI) {
let node = anchor;
({anchor}) = CustomizableUI.getWidget(anchor.id).forWindow(window);
({anchor} = CustomizableUI.getWidget(anchor.id).forWindow(window));
// if `node` is not the `anchor` itself, it means the widget is
// positioned in a panel, therefore we have to hide it before show

View File

@ -245,7 +245,7 @@ const map = (f, ...sequences) => seq(function* () {
let index = 0;
let value = void(0);
while (index < count && !done) {
({ done, value }) = inputs[index].next();
({ done, value } = inputs[index].next());
// If input is not exhausted yet store value in args.
if (!done) {
@ -273,10 +273,10 @@ const reductions = (...params) => {
let hasInitial = false;
let f, initial, source;
if (count === 2) {
([f, source]) = params;
[f, source] = params;
}
else if (count === 3) {
([f, initial, source]) = params;
[f, initial, source] = params;
hasInitial = true;
}
else {