Fix review nit from bug 385065 (unnecessary use of 'let')

This commit is contained in:
gavin@gavinsharp.com 2007-08-05 02:41:53 -07:00
Родитель bdb9e4be04
Коммит 2b47bbb7d1
2 изменённых файлов: 16 добавлений и 17 удалений

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

@ -85,12 +85,12 @@ var dialog = {
this.updateOKButton();
let description = {
var description = {
image: document.getElementById("description-image"),
text: document.getElementById("description-text")
};
let options = document.getElementById("item-action-text");
let checkbox = {
var options = document.getElementById("item-action-text");
var checkbox = {
desc: document.getElementById("remember"),
text: document.getElementById("remember-text")
};
@ -117,7 +117,7 @@ var dialog = {
populateList: function populateList()
{
// TODO: make this work with more than one (depends on Bug 385740)
let app = this._handlerInfo.preferredApplicationHandler;
var app = this._handlerInfo.preferredApplicationHandler;
if (app) {
let elm = document.createElement("richlistitem");
@ -154,10 +154,10 @@ var dialog = {
*/
chooseApplication: function chooseApplication()
{
let bundle = document.getElementById("base-strings");
let title = bundle.getString("choose.application.title");
var bundle = document.getElementById("base-strings");
var title = bundle.getString("choose.application.title");
let fp = Cc["@mozilla.org/filepicker;1"].createInstance(Ci.nsIFilePicker);
var fp = Cc["@mozilla.org/filepicker;1"].createInstance(Ci.nsIFilePicker);
fp.init(window, title, Ci.nsIFilePicker.modeOpen);
fp.appendFilters(Ci.nsIFilePicker.filterApps);
@ -186,7 +186,7 @@ var dialog = {
*/
onAccept: function onAccept()
{
let checkbox = document.getElementById("remember");
var checkbox = document.getElementById("remember");
if (!checkbox.hidden) {
// We need to make sure that the default is properly set now
if (this.selectedItem.obj) {
@ -199,7 +199,7 @@ var dialog = {
}
this._handlerInfo.alwaysAskBeforeHandling = !checkbox.checked;
let hs = Cc["@mozilla.org/uriloader/handler-service;1"].
var hs = Cc["@mozilla.org/uriloader/handler-service;1"].
getService(Ci.nsIHandlerService);
hs.store(this._handlerInfo);
@ -238,4 +238,3 @@ var dialog = {
return document.getElementById("items").selectedItem;
}
};

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

@ -67,21 +67,21 @@ nsContentDispatchChooser.prototype =
ask: function ask(aHandler, aWindowContext, aURI, aReason)
{
let window = null;
var window = null;
try {
if (aWindowContext)
window = aWindowContext.getInterface(Ci.nsIDOMWindow);
} catch (e) { /* it's OK to not have a window */ }
let sbs = Cc["@mozilla.org/intl/stringbundle;1"].
var sbs = Cc["@mozilla.org/intl/stringbundle;1"].
getService(Ci.nsIStringBundleService);
let bundle = sbs.createBundle(STRINGBUNDLE_URL);
var bundle = sbs.createBundle(STRINGBUNDLE_URL);
let xai = Cc["@mozilla.org/xre/app-info;1"].
var xai = Cc["@mozilla.org/xre/app-info;1"].
getService(Ci.nsIXULAppInfo);
// TODO when this is hooked up for content, we will need different strings
// for most of these
let arr = [bundle.GetStringFromName("protocol.title"),
var arr = [bundle.GetStringFromName("protocol.title"),
"",
bundle.GetStringFromName("protocol.description"),
bundle.GetStringFromName("protocol.choices.label"),
@ -90,7 +90,7 @@ nsContentDispatchChooser.prototype =
bundle.formatStringFromName("protocol.checkbox.extra",
[xai.name], 1)];
let params = Cc["@mozilla.org/array;1"].createInstance(Ci.nsIMutableArray);
var params = Cc["@mozilla.org/array;1"].createInstance(Ci.nsIMutableArray);
for each (let text in arr) {
let string = Cc["@mozilla.org/supports-string;1"].
createInstance(Ci.nsISupportsString);
@ -100,7 +100,7 @@ nsContentDispatchChooser.prototype =
params.appendElement(aHandler, false);
params.appendElement(aURI, false);
let ww = Cc["@mozilla.org/embedcomp/window-watcher;1"].
var ww = Cc["@mozilla.org/embedcomp/window-watcher;1"].
getService(Ci.nsIWindowWatcher);
ww.openWindow(window,
CONTENT_HANDLING_URL,