зеркало из https://github.com/mozilla/pjs.git
- venkman only -
bug 158181, "this.tabs has no properties error when script is unloaded" r=caillon, a=asa null check for content before we actually try to use it (in source2 view) also fixes spelling error, strict warning, and margin-clicking in the source2 view
This commit is contained in:
Родитель
490f5c0a1c
Коммит
7a048cbfc1
|
@ -33,7 +33,7 @@
|
|||
*
|
||||
*/
|
||||
|
||||
const __vnk_version = "0.9.23";
|
||||
const __vnk_version = "0.9.24";
|
||||
const __vnk_requiredLocale = "0.9.x";
|
||||
var __vnk_versionSuffix = "";
|
||||
|
||||
|
|
|
@ -2243,14 +2243,14 @@ function s2v_sourceclick (event)
|
|||
var target = event.target;
|
||||
while (target)
|
||||
{
|
||||
if (target.localName == "MARGIN")
|
||||
if (target.localName == "margin")
|
||||
break;
|
||||
target = target.parentNode;
|
||||
}
|
||||
|
||||
if (target && target.localName == "MARGIN")
|
||||
if (target && target.localName == "margin")
|
||||
{
|
||||
var line = parseInt (target.nextSibling.innerHTML);
|
||||
var line = parseInt (target.nextSibling.firstChild.data);
|
||||
sourceText.onMarginClick (event, line);
|
||||
}
|
||||
}
|
||||
|
@ -2365,16 +2365,22 @@ function s2v_cleardeck ()
|
|||
this.onSourceTabUnloaded (this.sourceTabList[i],
|
||||
Components.results.NS_OK);
|
||||
}
|
||||
|
||||
while (this.tabs.firstChild)
|
||||
this.tabs.removeChild (this.tabs.firstChild);
|
||||
while (this.deck.firstChild)
|
||||
this.deck.removeChild (this.deck.firstChild);
|
||||
|
||||
var bloke = document.createElement ("tab");
|
||||
bloke.setAttribute ("id", "source2-bloke");
|
||||
bloke.setAttribute ("hidden", "true");
|
||||
this.tabs.appendChild (bloke);
|
||||
if (this.tabs)
|
||||
{
|
||||
i = this.tabs.childNodes.length;
|
||||
while (i > 0)
|
||||
this.tabs.removeChild(this.tabs.childNodes[--i]);
|
||||
|
||||
i = this.deck.childNodes.length;
|
||||
while (i > 0)
|
||||
this.deck.removeChild (this.deck.childNodes[--i]);
|
||||
|
||||
var bloke = document.createElement ("tab");
|
||||
bloke.setAttribute ("id", "source2-bloke");
|
||||
bloke.setAttribute ("hidden", "true");
|
||||
this.tabs.appendChild (bloke);
|
||||
}
|
||||
}
|
||||
|
||||
console.views.source2.createFrameFor =
|
||||
|
@ -2490,7 +2496,6 @@ function s2v_removetext (sourceText)
|
|||
console.views.source2.removeSourceTabAtIndex =
|
||||
function s2v_removeindex (index)
|
||||
{
|
||||
var lastIndex = this.tabs.selectedIndex;
|
||||
var sourceTab = this.sourceTabList[index];
|
||||
if (this.highlightTab == sourceTab)
|
||||
this.unmarkHighlight();
|
||||
|
@ -2499,15 +2504,22 @@ function s2v_removeindex (index)
|
|||
sourceTab.content = null;
|
||||
sourceTab.stopNode = null;
|
||||
arrayRemoveAt (this.sourceTabList, index);
|
||||
if (this.tabs)
|
||||
this.tabs.removeItemAt(index);
|
||||
if (this.deck)
|
||||
this.deck.removeChild(this.deck.childNodes[index]);
|
||||
if (lastIndex >= this.sourceTabList.length)
|
||||
lastIndex = this.sourceTabList.length - 1;
|
||||
if (lastIndex >= 0)
|
||||
this.showTab(lastIndex);
|
||||
|
||||
if (this.tabs)
|
||||
{
|
||||
var lastIndex = this.tabs.selectedIndex;
|
||||
this.tabs.removeItemAt(index);
|
||||
this.deck.removeChild(this.deck.childNodes[index]);
|
||||
if (lastIndex >= this.sourceTabList.length)
|
||||
lastIndex = this.sourceTabList.length - 1;
|
||||
if (lastIndex >= 0)
|
||||
this.showTab(lastIndex);
|
||||
}
|
||||
else if (this.lastSelectedTab > this.sourceTabList.length)
|
||||
{
|
||||
this.lastSelectedTab = this.sourceTabList.length;
|
||||
}
|
||||
|
||||
if (this.sourceTabList.length == 0)
|
||||
this.clearOutputDeck();
|
||||
}
|
||||
|
@ -2838,12 +2850,15 @@ function sv_init()
|
|||
{
|
||||
this.savedState = new Object();
|
||||
|
||||
/*
|
||||
["save-source"],
|
||||
["-"],
|
||||
*/
|
||||
|
||||
console.menuSpecs["context:source"] = {
|
||||
getContext: this.getContext,
|
||||
items:
|
||||
[
|
||||
["save-source"],
|
||||
["-"],
|
||||
["break",
|
||||
{enabledif: "cx.lineIsExecutable && !has('hasBreak')"}],
|
||||
["clear",
|
||||
|
@ -2968,12 +2983,16 @@ function sv_show ()
|
|||
var sourceView = this;
|
||||
function cb ()
|
||||
{
|
||||
var sourceText = sourceView.childData;
|
||||
if (sourceText && sourceText.url in sourceView.savedState)
|
||||
if ("childData" in sourceView)
|
||||
{
|
||||
//dd ("clearing lastRowCount");
|
||||
delete sourceView.savedState[sourceText.url].lastRowCount;
|
||||
var sourceText = sourceView.childData;
|
||||
if (sourceText && sourceText.url in sourceView.savedState)
|
||||
{
|
||||
//dd ("clearing lastRowCount");
|
||||
delete sourceView.savedState[sourceText.url].lastRowCount;
|
||||
}
|
||||
}
|
||||
|
||||
sourceView.syncTreeView();
|
||||
sourceView.urlLabel = getChildById(sourceView.currentContent,
|
||||
"source-url");
|
||||
|
|
|
@ -653,7 +653,7 @@ cmd.scope.help = Lists the properties of the topmost object in the scope chain f
|
|||
|
||||
cmd.startup-init.label = Initialize at &Startup
|
||||
cmd.startup-init.params = [<toggle>]
|
||||
cmd.startup-init.help = Sets the state of the "Initialize at Startup" feature. With this feature enabled, the debugger will begin tracking scripts when the browser is first started, instead of waiting until the user interface is launched. This will allow the script list to display files that were loaded before you started the debugger user interface. This feature incurrs a *slight* performance hit, and so it is off by default. The value of <toggle> can be |true|, |on|, |yes|, or |1| to turn the flag on; |false|, |off|, |no|, or |0| to turn it off; or |toggle| to invert the current state. If <toggle> is not provided, the current state will be displayed.
|
||||
cmd.startup-init.help = Sets the state of the "Initialize at Startup" feature. With this feature enabled, the debugger will begin tracking scripts when the browser is first started, instead of waiting until the user interface is launched. This will allow the script list to display files that were loaded before you started the debugger user interface. This feature incurs a *slight* performance hit. The value of <toggle> can be |true|, |on|, |yes|, or |1| to turn the flag on; |false|, |off|, |no|, or |0| to turn it off; or |toggle| to invert the current state. If <toggle> is not provided, the current state will be displayed.
|
||||
|
||||
cmd.source-coloring.label = Colori&ze Source
|
||||
cmd.source-coloring.params = [<toggle>]
|
||||
|
|
Загрузка…
Ссылка в новой задаче