Bug 1167704 - Remove SpiderMonkey specific syntax in browser/devtools/shared and browser/devtools/framework; r=jryans

--HG--
extra : rebase_source : bdac5fb0f331073be700befe3b75453214c6a391
extra : histedit_source : 1920d0a9e56a217211f5f2c59101d820494ab74d
This commit is contained in:
Patrick Brosset 2015-05-22 21:17:11 +02:00
Родитель c1246b63e3
Коммит 8b742571be
11 изменённых файлов: 35 добавлений и 27 удалений

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

@ -29,7 +29,7 @@ function test() {
function runTests1(aTab) {
let toolDefinition = {
id: toolId1,
isTargetSupported: function() true,
isTargetSupported: () => true,
visibilityswitch: "devtools.test-tool.enabled",
url: "about:blank",
label: "someLabel",
@ -90,7 +90,7 @@ function runTests1(aTab) {
function runTests2() {
let toolDefinition = {
id: toolId2,
isTargetSupported: function() true,
isTargetSupported: () => true,
visibilityswitch: "devtools.test-tool.enabled",
url: "about:blank",
label: "someLabel",
@ -229,11 +229,17 @@ DevToolPanel.prototype = {
return deferred.promise;
},
get target() this._toolbox.target,
get target() {
return this._toolbox.target;
},
get toolbox() this._toolbox,
get toolbox() {
return this._toolbox;
},
get isReady() this._isReady,
get isReady() {
return this._isReady;
},
_isReady: false,

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

@ -13,7 +13,7 @@ function runTests(aTab) {
let toolDefinition = {
id: "testTool",
visibilityswitch: "devtools.testTool.enabled",
isTargetSupported: function() true,
isTargetSupported: () => true,
url: "about:blank",
label: "someLabel",
build: function(iframeWindow, toolbox) {

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

@ -26,7 +26,7 @@ function testRegister(aToolbox)
id: "test-tool",
label: "Test Tool",
inMenu: true,
isTargetSupported: function() true,
isTargetSupported: () => true,
build: function() {}
});
}

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

@ -23,7 +23,7 @@ add_task(function*() {
function registerNewTool() {
let toolDefinition = {
id: "test-tool",
isTargetSupported: function() true,
isTargetSupported: () => true,
visibilityswitch: "devtools.test-tool.enabled",
url: "about:blank",
label: "someLabel"

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

@ -27,7 +27,7 @@ function test() {
visibilityswitch: "devtools.fakeTool4242.enabled",
url: toolURL,
label: "FAKE TOOL!!!",
isTargetSupported: function() true,
isTargetSupported: () => true,
build: function(iframeWindow, toolbox) {
let deferred = promise.defer();
executeSoon(() => {
@ -35,7 +35,7 @@ function test() {
target: toolbox.target,
toolbox: toolbox,
isReady: true,
destroy: function(){},
destroy: function() {},
panelDoc: iframeWindow.document,
});
});

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

@ -22,7 +22,7 @@ function test() {
visibilityswitch: "devtools.testTool1072208.enabled",
url: toolURL,
label: "Test tool",
isTargetSupported: function() true,
isTargetSupported: () => true,
build: function(iframeWindow, toolbox) {
let deferred = promise.defer();
executeSoon(() => {
@ -30,7 +30,7 @@ function test() {
target: toolbox.target,
toolbox: toolbox,
isReady: true,
destroy: function(){},
destroy: function() {},
panelDoc: iframeWindow.document,
});
});

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

@ -4,12 +4,12 @@
///////////////////
//
// Whitelisting this test.
// As part of bug 1077403, the leaking uncaught rejection should be fixed.
// As part of bug 1077403, the leaking uncaught rejection should be fixed.
//
thisTestLeaksUncaughtRejectionsAndShouldBeFixed("Error: Shader Editor is still waiting for a WebGL context to be created.");
function performChecks(target) {
return Task.spawn(function() {
return Task.spawn(function*() {
let toolIds = gDevTools.getToolDefinitionArray()
.filter(def => def.isTargetSupported(target))
.map(def => def.id);
@ -32,7 +32,7 @@ function performChecks(target) {
}
function test() {
Task.spawn(function() {
Task.spawn(function*() {
toggleAllTools(true);
let tab = yield addTab("about:blank");
let target = TargetFactory.forTab(tab);

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

@ -4,7 +4,7 @@
///////////////////
//
// Whitelisting this test.
// As part of bug 1077403, the leaking uncaught rejection should be fixed.
// As part of bug 1077403, the leaking uncaught rejection should be fixed.
//
thisTestLeaksUncaughtRejectionsAndShouldBeFixed("Error: Shader Editor is still waiting for a WebGL context to be created.");
@ -40,7 +40,7 @@ const { DebuggerClient } =
*/
function runTools(target) {
return Task.spawn(function() {
return Task.spawn(function*() {
let toolIds = gDevTools.getToolDefinitionArray()
.filter(def => def.isTargetSupported(target))
.map(def => def.id);
@ -96,7 +96,7 @@ function getTarget(client) {
}
function test() {
Task.spawn(function() {
Task.spawn(function*() {
toggleAllTools(true);
yield addTab("about:blank");

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

@ -23,20 +23,20 @@ function test() {
let target = TargetFactory.forTab(gBrowser.selectedTab);
gDevTools.showToolbox(target, null, Toolbox.HostType.BOTTOM)
.then(function (aToolbox) { toolbox = aToolbox; })
.then(function () toolbox.selectTool(TOOL_ID_1))
.then(() => toolbox.selectTool(TOOL_ID_1))
// undock toolbox and check title
.then(function () toolbox.switchHost(Toolbox.HostType.WINDOW))
.then(() => toolbox.switchHost(Toolbox.HostType.WINDOW))
.then(checkTitle.bind(null, LABEL_1, URL_1, "toolbox undocked"))
// switch to different tool and check title
.then(function () toolbox.selectTool(TOOL_ID_2))
.then(() => toolbox.selectTool(TOOL_ID_2))
.then(checkTitle.bind(null, LABEL_2, URL_1, "tool changed"))
// navigate to different url and check title
.then(function () {
let deferred = promise.defer();
target.once("navigate", function () deferred.resolve());
target.once("navigate", () => deferred.resolve());
gBrowser.loadURI(URL_2);
return deferred.promise;
})
@ -55,12 +55,12 @@ function test() {
return gDevTools.showToolbox(target, null, Toolbox.HostType.WINDOW);
})
.then(function (aToolbox) { toolbox = aToolbox; })
.then(function () toolbox.selectTool(TOOL_ID_1))
.then(() => toolbox.selectTool(TOOL_ID_1))
.then(checkTitle.bind(null, LABEL_1, URL_2,
"toolbox destroyed and recreated"))
// clean up
.then(function () toolbox.destroy())
.then(() => toolbox.destroy())
.then(function () {
toolbox = null;
gBrowser.removeCurrentTab();

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

@ -111,7 +111,7 @@ function testAdvanceCharsFunction(doc) {
return aText.length > 0;
},
start: function(editor) {
for each (let ch in ":Test:") {
for (let ch of ":Test:") {
EventUtils.sendChar(ch);
}
},

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

@ -44,7 +44,7 @@ function promiseTab(aURL) {
addTab(aURL, resolve));
}
registerCleanupFunction(function tearDown() {
registerCleanupFunction(function* tearDown() {
let target = TargetFactory.forTab(gBrowser.selectedTab);
yield gDevTools.closeToolbox(target);
@ -126,7 +126,9 @@ function waitForValue(aOptions)
successFn(aOptions, lastValue);
}
else {
setTimeout(function() wait(validatorFn, successFn, failureFn), 100);
setTimeout(() => {
wait(validatorFn, successFn, failureFn);
}, 100);
}
}