Bug 1146136 - Fix most in-tree tests that parenthesize destructuring pattern assignment targets, as ES6 forbids such parenthesization. (The patch making SpiderMonkey reject this syntax will follow shortly.) r=efaust, r=testingonlychange

This commit is contained in:
Jeff Walden 2015-05-30 00:55:35 -07:00
Родитель e94846adea
Коммит 8ebc2cc372
24 изменённых файлов: 38 добавлений и 38 удалений

Просмотреть файл

@ -12,7 +12,7 @@ add_task(function*() {
let {inspector, panel} = yield openAnimationInspector();
yield testEmptyPanel(inspector, panel);
({inspector, panel}) = yield closeAnimationInspectorAndRestartWithNewUI();
({inspector, panel} = yield closeAnimationInspectorAndRestartWithNewUI());
yield testEmptyPanel(inspector, panel, true);
});

Просмотреть файл

@ -16,7 +16,7 @@ add_task(function*() {
ok(panel, "The animation panel exists");
ok(panel.playersEl, "The animation panel has been initialized");
({panel, controller}) = yield closeAnimationInspectorAndRestartWithNewUI();
({panel, controller} = yield closeAnimationInspectorAndRestartWithNewUI());
ok(controller, "The animation controller exists");
ok(controller.animationsFront, "The animation controller has been initialized");

Просмотреть файл

@ -14,7 +14,7 @@ add_task(function*() {
is(panel.playerWidgets.length, 1,
"One animation player is displayed after init");
({panel}) = yield closeAnimationInspectorAndRestartWithNewUI();
({panel} = yield closeAnimationInspectorAndRestartWithNewUI());
is(panel.animationsTimelineComponent.animations.length, 1,
"One animation is handled by the timeline after init");
is(panel.animationsTimelineComponent.animationsEl.childNodes.length, 1,

Просмотреть файл

@ -31,7 +31,7 @@ add_task(function*() {
"The icon to select the target element in the inspector exists");
info("Test again with the new timeline UI");
({inspector, panel}) = yield closeAnimationInspectorAndRestartWithNewUI();
({inspector, panel} = yield closeAnimationInspectorAndRestartWithNewUI());
info("Select the simple animated node");
yield selectNode(".animated", inspector);

Просмотреть файл

@ -12,7 +12,7 @@ add_task(function*() {
let {inspector, panel} = yield openAnimationInspector();
yield testRefreshOnNewAnimation(inspector, panel);
({inspector, panel}) = yield closeAnimationInspectorAndRestartWithNewUI();
({inspector, panel} = yield closeAnimationInspectorAndRestartWithNewUI());
yield testRefreshOnNewAnimation(inspector, panel);
});

Просмотреть файл

@ -14,7 +14,7 @@ add_task(function*() {
yield testAddedAnimationWorks(inspector, panel);
info("Reload and test again with the new UI");
({inspector, panel}) = yield closeAnimationInspectorAndRestartWithNewUI(true);
({inspector, panel} = yield closeAnimationInspectorAndRestartWithNewUI(true));
yield testRefreshOnRemove(inspector, panel, true);
});

Просмотреть файл

@ -12,7 +12,7 @@ add_task(function*() {
let {inspector, panel} = yield openAnimationInspector();
yield testRefresh(inspector, panel);
({inspector, panel}) = yield closeAnimationInspectorAndRestartWithNewUI();
({inspector, panel} = yield closeAnimationInspectorAndRestartWithNewUI());
yield testRefresh(inspector, panel);
});

Просмотреть файл

@ -25,7 +25,7 @@ add_task(function*() {
info("Test again with the new UI, making sure the same number of " +
"animation timelines is created");
({inspector, panel, controller}) = yield closeAnimationInspectorAndRestartWithNewUI();
({inspector, panel, controller} = yield closeAnimationInspectorAndRestartWithNewUI());
let timeline = panel.animationsTimelineComponent;
info("Selecting the test animated node again");

Просмотреть файл

@ -13,7 +13,7 @@ add_task(function*() {
let {inspector, panel} = yield openAnimationInspector();
yield testShowsAnimations(inspector, panel);
({inspector, panel}) = yield closeAnimationInspectorAndRestartWithNewUI();
({inspector, panel} = yield closeAnimationInspectorAndRestartWithNewUI());
yield testShowsAnimations(inspector, panel);
});

Просмотреть файл

@ -73,13 +73,13 @@ const TEST_DATA = [
let {d} = yield getHighlighterRegionPath("margin", toolbox.highlighter);
ok(!d, "margin region is hidden");
({d}) = yield getHighlighterRegionPath("border", toolbox.highlighter);
({d} = yield getHighlighterRegionPath("border", toolbox.highlighter));
ok(!d, "border region is hidden");
({d}) = yield getHighlighterRegionPath("padding", toolbox.highlighter);
({d} = yield getHighlighterRegionPath("padding", toolbox.highlighter));
ok(!d, "padding region is hidden");
({d}) = yield getHighlighterRegionPath("content", toolbox.highlighter);
({d} = yield getHighlighterRegionPath("content", toolbox.highlighter));
ok(d, "content region is shown");
}
},
@ -90,13 +90,13 @@ const TEST_DATA = [
let {d} = yield getHighlighterRegionPath("margin", toolbox.highlighter);
ok(d, "margin region is shown");
({d}) = yield getHighlighterRegionPath("border", toolbox.highlighter);
({d} = yield getHighlighterRegionPath("border", toolbox.highlighter));
ok(!d, "border region is hidden");
({d}) = yield getHighlighterRegionPath("padding", toolbox.highlighter);
({d} = yield getHighlighterRegionPath("padding", toolbox.highlighter));
ok(!d, "padding region is hidden");
({d}) = yield getHighlighterRegionPath("content", toolbox.highlighter);
({d} = yield getHighlighterRegionPath("content", toolbox.highlighter));
ok(!d, "content region is hidden");
}
},

Просмотреть файл

@ -71,11 +71,11 @@ function* isUpdatedAfterScroll(highlighterFront, inspector) {
info("Asking the content window to scroll relative to the current position");
({ data }) = yield executeInContent("Test:ScrollWindow", {
({ data } = yield executeInContent("Test:ScrollWindow", {
x: -50,
y: -60,
relative: true
});
}));
is(data.x, x - 50, "window scrolled properly horizontally");
is(data.y, y - 60, "window scrolled properly vertically");

Просмотреть файл

@ -29,7 +29,7 @@ add_task(function*() {
yield nodeMutated;
info("Checking for links in the updated attribute");
({editor}) = yield getContainerForSelector("body", inspector);
({editor} = yield getContainerForSelector("body", inspector));
linkEls = editor.attrElements.get("contextmenu").querySelectorAll(".link");
is(linkEls.length, 1, "There is one link in the contextmenu attribute");
is(linkEls[0].dataset.type, "idref", "The link has the right type");

Просмотреть файл

@ -29,7 +29,7 @@ add_task(function*() {
yield onMutated;
info("Checking for links in the updated attribute");
({editor}) = yield getContainerForSelector("body", inspector);
({editor} = yield getContainerForSelector("body", inspector));
linkEls = editor.attrElements.get("contextmenu").querySelectorAll(".link");
is(linkEls.length, 1, "There is one link in the contextmenu attribute");
is(linkEls[0].dataset.type, "idref", "The link has the right type");

Просмотреть файл

@ -35,7 +35,7 @@ add_task(function*() {
yield selectNode("label", inspector);
info("Set the popupNode to the node that contains the ref");
({editor}) = yield getContainerForSelector("label", inspector);
({editor} = yield getContainerForSelector("label", inspector));
popupNode = editor.attrElements.get("for").querySelector(".link");
inspector.panelDoc.popupNode = popupNode;
@ -51,7 +51,7 @@ add_task(function*() {
yield selectNode("output", inspector);
info("Set the popupNode to the node that contains the ref");
({editor}) = yield getContainerForSelector("output", inspector);
({editor} = yield getContainerForSelector("output", inspector));
popupNode = editor.attrElements.get("for").querySelectorAll(".link")[2];
inspector.panelDoc.popupNode = popupNode;

Просмотреть файл

@ -36,7 +36,7 @@ add_task(function*() {
yield selectNode("script", inspector);
info("Set the popupNode to the node that contains the uri");
({editor}) = yield getContainerForSelector("script", inspector);
({editor} = yield getContainerForSelector("script", inspector));
popupNode = editor.attrElements.get("src").querySelector(".link");
inspector.panelDoc.popupNode = popupNode;

Просмотреть файл

@ -829,10 +829,10 @@ InplaceEditor.prototype = {
this.popup.selectedIndex >= 0) {
let label, preLabel;
if (this._selectedIndex === undefined) {
({label, preLabel}) = this.popup.getItemAtIndex(this.popup.selectedIndex);
({label, preLabel} = this.popup.getItemAtIndex(this.popup.selectedIndex));
}
else {
({label, preLabel}) = this.popup.getItemAtIndex(this._selectedIndex);
({label, preLabel} = this.popup.getItemAtIndex(this._selectedIndex));
}
let input = this.input;
let pre = "";

Просмотреть файл

@ -49,7 +49,7 @@ testAll(testConst);
function testGlobal(pattern, input) {
return new Function('input',
'(' + pattern + ') = input;' +
'(' + pattern + ' = input);' +
'return [a, b, c, d, e, f];'
)(input);
}
@ -58,7 +58,7 @@ testAll(testGlobal);
function testClosure(pattern, input) {
return new Function('input',
'var rest; (function () {' +
'(' + pattern + ') = input;' +
'(' + pattern + ' = input);' +
'})();' +
'return [a, b, c, d, e, f];'
)(input);
@ -113,7 +113,7 @@ assertEq(cc, 3);
// test that the assignment happens in source order
var a = undefined, b = undefined, c = undefined;
({a: a = 1, c: c = 2, b: b = 3}) = {
({a: a = 1, c: c = 2, b: b = 3} = {
get a() {
assertEq(a, undefined);
assertEq(c, undefined);
@ -132,7 +132,7 @@ var a = undefined, b = undefined, c = undefined;
assertEq(b, undefined);
return undefined;
}
};
});
assertEq(b, 4);
assertThrowsInstanceOf(() => { var {a: {a} = null} = {}; }, TypeError);
@ -150,7 +150,7 @@ assertEq(a.y, 2);
// defaults are evaluated even if there is no binding
var evaled = false;
({a: {} = (evaled = true, {})}) = {};
({a: {} = (evaled = true, {})} = {});
assertEq(evaled, true);
evaled = false;
assertThrowsInstanceOf(() => { [[] = (evaled = true, 2)] = [] }, TypeError);

Просмотреть файл

@ -81,7 +81,7 @@ testDeclaration(testVar);
function testGlobal(pattern, input, binding) {
binding = binding || 'rest';
return new Function('input',
'(' + pattern + ') = input;' +
'(' + pattern + ' = input);' +
'return ' + binding
)(input);
}
@ -91,7 +91,7 @@ function testClosure(pattern, input, binding) {
binding = binding || 'rest';
return new Function('input',
'var ' + binding + '; (function () {' +
'(' + pattern + ') = input;' +
'(' + pattern + ' = input);' +
'})();' +
'return ' + binding
)(input);

Просмотреть файл

@ -30,7 +30,7 @@ function partialEvalObj()
{
try
{
({a:a, b:b}) = exceptObj();
({a:a, b:b} = exceptObj());
throw "FAILED";
}
catch (ex)
@ -114,7 +114,7 @@ function objWithGetters()
function partialEvalObj2()
{
({g: g, h: h, i: i, j: j, k: k}) = objWithGetters();
({g: g, h: h, i: i, j: j, k: k} = objWithGetters());
}
try

Просмотреть файл

@ -20,7 +20,7 @@ function test()
printBugNumber(BUGNUMBER);
printStatus (summary);
({ x: a }) = {}
({ x: a } = {});
reportCompare(expect, actual, summary);

Просмотреть файл

@ -22,7 +22,7 @@ function test()
reportCompare(expect, actual, summary);
(function () { ({ y: [] }) = {} });
(function () { ({ y: [] } = {}); });
exitFunc ('test');
}

Просмотреть файл

@ -115,7 +115,7 @@
Cc["@mozilla.org/network/http-auth-manager;1"].getService(SpecialPowers.Ci.nsIHttpAuthManager).clearAll();
if (pendingTests.length > 0) {
({expectedDialogs: gExpectedDialogs,
test: gCurrentTest}) = pendingTests.shift();
test: gCurrentTest} = pendingTests.shift());
gCurrentTest.call(this);
} else {
cleanup();

Просмотреть файл

@ -266,7 +266,7 @@ function createScreenshotData(document, args) {
}
else if (args.selector) {
const lh = new LayoutHelpers(window);
({ top, left, width, height }) = lh.getRect(args.selector, window);
({ top, left, width, height } = lh.getRect(args.selector, window));
}
else {
left = window.scrollX;

Просмотреть файл

@ -50,7 +50,7 @@ function newConnection(aPrefix)
/* Create the main connection for these tests. */
function createMainConnection()
{
({ conn: gMainConnection, transport: gMainTransport }) = newConnection();
({ conn: gMainConnection, transport: gMainTransport } = newConnection());
gClient = new DebuggerClient(gMainTransport);
gClient.connect((aType, aTraits) => run_next_test());
}