зеркало из https://github.com/mozilla/gecko-dev.git
- venkman only -
bug 160003, "land venkman 0.9.28", a=asa Adds "scriptable breakpoints" and "meta comments", described in <news://news.mozilla.org:119/3D45310E.8080206@netscape.com>. Also adds "run to cursor" and "find in file" functionaliy, and fixes bug 126779.
This commit is contained in:
Родитель
9fabd5e4e5
Коммит
072d6e6436
|
@ -330,27 +330,15 @@ function cmgr_hook (commandName, func, id, before)
|
|||
|
||||
if (before)
|
||||
{
|
||||
if (!("beforeHookNames" in command))
|
||||
command.beforeHookNames = new Array();
|
||||
if (!("beforeHooks" in command))
|
||||
command.beforeHooks = new Object();
|
||||
if (id in command.beforeHooks)
|
||||
{
|
||||
arrayRemoveAt(command.beforeHookNames,
|
||||
command.beforeHooks[id][id + "_hookIndex"]);
|
||||
}
|
||||
command.beforeHooks[id] = func;
|
||||
command.beforeHookNames.push(id);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!("afterHookNames" in command))
|
||||
command.afterHookNames = new Array();
|
||||
if (!("afterHooks" in command))
|
||||
command.afterHooks = new Object();
|
||||
func[id + "_hookIndex"] = command.afterHookNames.length
|
||||
command.afterHooks[id] = func;
|
||||
command.afterHookNames.push(id);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -363,7 +351,7 @@ function cmgr_hooks (hooks, prefix)
|
|||
for (var h in hooks)
|
||||
{
|
||||
this.addHook(h, hooks[h], prefix + ":" + h,
|
||||
("before" in hooks[h]) ? hooks[h].before : false);
|
||||
("_before" in hooks[h]) ? hooks[h]._before : false);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -386,30 +374,9 @@ function cmgr_unhook (commandName, id, before)
|
|||
var command = this.commands[commandName];
|
||||
|
||||
if (before)
|
||||
{
|
||||
arrayRemoveAt(command.beforeHookNames,
|
||||
command.beforeHooks[id][id + "_hookIndex"]);
|
||||
delete command.beforeHooks[id][id + "_hookIndex"];
|
||||
delete command.beforeHooks[id];
|
||||
if (keys(command.beforeHooks).length == 0)
|
||||
{
|
||||
delete command.beforeHookNames;
|
||||
delete command.beforeHooks;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
arrayRemoveAt(command.afterHookNames,
|
||||
command.afterHooks[id][id + "_hookIndex"]);
|
||||
delete command.afterHooks[id][id + "_hookIndex"];
|
||||
delete command.afterHooks[id];
|
||||
if (command.afterHookNames.length == 0)
|
||||
{
|
||||
delete command.afterHookNames;
|
||||
delete command.afterHooks;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -135,9 +135,11 @@ function dbg2()
|
|||
var nope = null;
|
||||
var f = false;
|
||||
var i = 4;
|
||||
//@JSD_BREAK
|
||||
var d = Number.MAX_VALUE;
|
||||
var s = "hello world";
|
||||
var fun = dbg;
|
||||
//@JSD_BREAK s == "hello world"
|
||||
var obj = new Object();
|
||||
debugger;
|
||||
|
||||
|
@ -151,8 +153,13 @@ function dbg2()
|
|||
dd ("caught " + ex);
|
||||
}
|
||||
|
||||
//@JSD_EVAL alert("foo");
|
||||
var rv = returnSomething();
|
||||
|
||||
//@JSD_LOG "this is a log message";
|
||||
|
||||
dd ("returned " + rv);
|
||||
|
||||
}
|
||||
|
||||
function throwSomething()
|
||||
|
|
|
@ -36,6 +36,8 @@
|
|||
-
|
||||
-->
|
||||
|
||||
<!DOCTYPE window SYSTEM "chrome://venkman/locale/venkman.dtd">
|
||||
|
||||
<bindings xmlns="http://www.mozilla.org/xbl"
|
||||
xmlns:xbl="http://www.mozilla.org/xbl"
|
||||
xmlns:xul=
|
||||
|
@ -51,15 +53,18 @@
|
|||
ondraggesture="console.dnd.startDrag(event, console.viewProxyTitle);">
|
||||
<xul:hbox id="view-title">
|
||||
<xul:image class="view-title-pop"
|
||||
tooltiptext="&ViewFloat.tooltip;"
|
||||
xbl:inherits="parentid=id"
|
||||
onclick="console.dispatch('toggle-float', { viewId: this.getAttribute('parentid')});"/>
|
||||
<xul:hbox class="view-title-grippy" flex="1">
|
||||
<xul:hbox class="view-title-grippy" flex="1"
|
||||
tooltiptext="&ViewGrippy.tooltip;">
|
||||
<xul:hbox flex="1" class="view-title-margin-left"/>
|
||||
<xul:label id="view-title-text" xbl:inherits="value=title"/>
|
||||
<xul:hbox flex="1" class="view-title-margin-right"/>
|
||||
</xul:hbox>
|
||||
<xul:image class="view-title-close"
|
||||
xbl:inherits="parentid=id"
|
||||
tooltiptext="&ViewClose.tooltip;"
|
||||
onclick="console.dispatch('toggle-view', { viewId: this.getAttribute('parentid')});"/>
|
||||
</xul:hbox>
|
||||
</xul:vbox>
|
||||
|
|
|
@ -0,0 +1,189 @@
|
|||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License
|
||||
* Version 1.1 (the "License"); you may not use this file except in
|
||||
* compliance with the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is The JavaScript Debugger
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Netscape Communications Corporation
|
||||
* Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation.
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the
|
||||
* terms of the GNU Public License (the "GPL"), in which case the
|
||||
* provisions of the GPL are applicable instead of those above.
|
||||
* If you wish to allow use of your version of this file only
|
||||
* under the terms of the GPL and not to allow others to use your
|
||||
* version of this file under the MPL, indicate your decision by
|
||||
* deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this
|
||||
* file under either the MPL or the GPL.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Robert Ginda, <rginda@netscape.com>, original author
|
||||
*
|
||||
*/
|
||||
|
||||
var dialog = new Object();
|
||||
var breakpoint;
|
||||
|
||||
function onLoad()
|
||||
{
|
||||
function cacheElement(id)
|
||||
{
|
||||
dialog[id] = document.getElementById(id);
|
||||
};
|
||||
|
||||
breakpoint = window.arguments[0];
|
||||
cacheElement("url-textbox");
|
||||
cacheElement("line-textbox");
|
||||
cacheElement("function-textbox");
|
||||
cacheElement("pc-textbox");
|
||||
cacheElement("condition-checkbox");
|
||||
cacheElement("trigger-textbox");
|
||||
cacheElement("enabled-checkbox");
|
||||
cacheElement("onetime-checkbox");
|
||||
cacheElement("condition-textbox");
|
||||
cacheElement("result-radio");
|
||||
cacheElement("exception-checkbox");
|
||||
cacheElement("log-checkbox");
|
||||
|
||||
cacheElement("apply-button");
|
||||
cacheElement("revert-button");
|
||||
cacheElement("close-button");
|
||||
|
||||
populateFromBreakpoint();
|
||||
}
|
||||
|
||||
function onUnload()
|
||||
{
|
||||
delete breakpoint.propsWindow;
|
||||
}
|
||||
|
||||
function onBreakpointTriggered()
|
||||
{
|
||||
dialog["trigger-textbox"].value = breakpoint.triggerCount;
|
||||
}
|
||||
|
||||
function onConditionKeyPress(event)
|
||||
{
|
||||
if (event.keyCode == 9)
|
||||
{
|
||||
opener.dd(dialog["condition-textbox"].selectionStart);
|
||||
event.preventDefault();
|
||||
}
|
||||
}
|
||||
|
||||
function populateFromBreakpoint()
|
||||
{
|
||||
dialog["url-textbox"].value = breakpoint.url;
|
||||
dialog["line-textbox"].value = breakpoint.lineNumber;
|
||||
|
||||
dialog["condition-checkbox"].checked = breakpoint.conditionEnabled;
|
||||
if ("scriptWrapper" in breakpoint)
|
||||
{
|
||||
window.title = opener.MSG_BPPROPS_TITLE;
|
||||
dialog["enabled-checkbox"].setAttribute("label",
|
||||
opener.MSG_BPPROPS_ENABLED);
|
||||
dialog["function-textbox"].value = breakpoint.scriptWrapper.functionName;
|
||||
dialog["pc-textbox"].value = breakpoint.pc;
|
||||
dialog["onetime-checkbox"].checked = breakpoint.oneTime;
|
||||
dialog["trigger-textbox"].value = breakpoint.triggerCount;
|
||||
}
|
||||
else
|
||||
{
|
||||
window.title = opener.MSG_FBPPROPS_TITLE;
|
||||
dialog["enabled-checkbox"].setAttribute("label",
|
||||
opener.MSG_FBPPROPS_ENABLED);
|
||||
dialog["function-textbox"].value = opener.MSG_VAL_NA;
|
||||
dialog["pc-textbox"].value = opener.MSG_VAL_NONE;
|
||||
dialog["onetime-checkbox"].disabled = true;
|
||||
dialog["trigger-textbox"].disabled = true;
|
||||
}
|
||||
|
||||
dialog["enabled-checkbox"].checked = breakpoint.enabled;
|
||||
dialog["condition-textbox"].value = breakpoint.condition;
|
||||
dialog["result-radio"].selectedItem =
|
||||
dialog["result-radio"].childNodes[breakpoint.resultAction];
|
||||
dialog["exception-checkbox"].checked = breakpoint.passExceptions;
|
||||
dialog["log-checkbox"].checked = breakpoint.logResult;
|
||||
updateConditionGroup();
|
||||
makeClean();
|
||||
}
|
||||
|
||||
function copyToBreakpoint()
|
||||
{
|
||||
breakpoint.conditionEnabled = dialog["condition-checkbox"].checked;
|
||||
if ("scriptWrapper" in breakpoint)
|
||||
{
|
||||
breakpoint.oneTime = dialog["onetime-checkbox"].checked;
|
||||
breakpoint.triggerCount = dialog["trigger-textbox"].value;
|
||||
}
|
||||
|
||||
breakpoint.enabled = dialog["enabled-checkbox"].checked;
|
||||
for (var i = 0; i < 4; ++i)
|
||||
{
|
||||
if (dialog["result-radio"].childNodes[i] ==
|
||||
dialog["result-radio"].selectedItem)
|
||||
{
|
||||
dd ("result radio is " + i);
|
||||
breakpoint.resultAction = i;
|
||||
break;
|
||||
}
|
||||
else
|
||||
dd ("not at index " + i);
|
||||
}
|
||||
breakpoint.condition = dialog["condition-textbox"].value;
|
||||
breakpoint.passExceptions = dialog["exception-checkbox"].checked;
|
||||
breakpoint.logResult = dialog["log-checkbox"].checked;
|
||||
makeClean();
|
||||
}
|
||||
|
||||
function updateConditionGroup()
|
||||
{
|
||||
function ableNode (node)
|
||||
{
|
||||
node.disabled = !state;
|
||||
if (node.childNodes.length > 0)
|
||||
{
|
||||
for (var i = 0; i < node.childNodes.length; ++i)
|
||||
ableNode(node.childNodes[i]);
|
||||
}
|
||||
};
|
||||
|
||||
var state = dialog["condition-checkbox"].checked;
|
||||
|
||||
var kid = dialog["condition-checkbox"].parentNode.nextSibling;
|
||||
|
||||
while (kid)
|
||||
{
|
||||
ableNode(kid);
|
||||
kid = kid.nextSibling;
|
||||
}
|
||||
}
|
||||
|
||||
function makeDirty()
|
||||
{
|
||||
dialog["apply-button"].disabled = false;
|
||||
dialog["revert-button"].disabled = false;
|
||||
dialog["close-button"].disabled = true;
|
||||
}
|
||||
|
||||
function makeClean()
|
||||
{
|
||||
dialog["apply-button"].disabled = true;
|
||||
dialog["revert-button"].disabled = true;
|
||||
dialog["close-button"].disabled = false;
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,127 @@
|
|||
<?xml version="1.0"?>
|
||||
|
||||
<!--
|
||||
-
|
||||
- The contents of this file are subject to the Mozilla Public License
|
||||
- Version 1.1 (the "License"); you may not use this file except in
|
||||
- compliance with the License. You may obtain a copy of the License at
|
||||
- http://www.mozilla.org/MPL/
|
||||
-
|
||||
- Software distributed under the License is distributed on an "AS IS" basis,
|
||||
- WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
- for the specific language governing rights and limitations under the
|
||||
- License.
|
||||
-
|
||||
- The Original Code is The JavaScript Debugger
|
||||
-
|
||||
- The Initial Developer of the Original Code is
|
||||
- Netscape Communications Corporation
|
||||
- Portions created by Netscape are
|
||||
- Copyright (C) 1998 Netscape Communications Corporation.
|
||||
- All Rights Reserved.
|
||||
-
|
||||
- Alternatively, the contents of this file may be used under the
|
||||
- terms of the GNU Public License (the "GPL"), in which case the
|
||||
- provisions of the GPL are applicable instead of those above.
|
||||
- If you wish to allow use of your version of this file only
|
||||
- under the terms of the GPL and not to allow others to use your
|
||||
- version of this file under the MPL, indicate your decision by
|
||||
- deleting the provisions above and replace them with the notice
|
||||
- and other provisions required by the GPL. If you do not delete
|
||||
- the provisions above, a recipient may use your version of this
|
||||
- file under either the MPL or the GPL.
|
||||
-
|
||||
- Contributor(s):
|
||||
- Robert Ginda, <rginda@netscape.com>, original author
|
||||
-
|
||||
-->
|
||||
|
||||
<!DOCTYPE window SYSTEM "chrome://venkman/locale/venkman.dtd">
|
||||
|
||||
<?xml-stylesheet href="chrome://venkman/skin/venkman.css" type="text/css"?>
|
||||
|
||||
<window id="venkman-window"
|
||||
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
|
||||
onload="onLoad();" onunload="onUnload();"
|
||||
width="500" height="480"
|
||||
persist="width height screenX screenY"
|
||||
windowtype="mozapp:venkman:bp-props">
|
||||
|
||||
<script>
|
||||
var DEBUG = true;
|
||||
</script>
|
||||
<script src="chrome://venkman/content/venkman-utils.js"/>
|
||||
<script src="chrome://venkman/content/venkman-bpprops.js"/>
|
||||
|
||||
<hbox align="baseline">
|
||||
<label value="&BPProps.URL.label;" minwidth="50px"/>
|
||||
<textbox flex="1" readonly="true" id="url-textbox"/>
|
||||
<label value="&BPProps.Line.label;" minwidth="25px"/>
|
||||
<textbox readonly="true" id="line-textbox" width="50px"/>
|
||||
</hbox>
|
||||
<hbox align="baseline">
|
||||
<label value="&BPProps.FunctionName.label;" minwidth="50px"/>
|
||||
<textbox flex="1" readonly="true" id="function-textbox" width="50px"/>
|
||||
<label value="&BPProps.PC.label;" minwidth="25px"/>
|
||||
<textbox readonly="true" id="pc-textbox" width="50px"/>
|
||||
</hbox>
|
||||
|
||||
<hbox align="baseline">
|
||||
<checkbox id="enabled-checkbox" label="XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
|
||||
oncommand="makeDirty()" flex="1"/>
|
||||
<checkbox id="onetime-checkbox" label="&BPProps.OneTime.label;"
|
||||
oncommand="makeDirty()" flex="1"/>
|
||||
<label value="&BPProps.TriggerCount.label;"/>
|
||||
<textbox id="trigger-textbox" width="50px"
|
||||
oninput="makeDirty()"/>
|
||||
</hbox>
|
||||
|
||||
<vbox flex="1">
|
||||
<groupbox flex="1">
|
||||
<caption>
|
||||
<checkbox flex="1" id="condition-checkbox"
|
||||
oncommand="updateConditionGroup(); makeDirty()"
|
||||
label="&BPProps.ConditionalCheck.label;"/>
|
||||
</caption>
|
||||
|
||||
<textbox readonly="true"
|
||||
value="function __trigger__(__count__) {"/>
|
||||
<textbox flex="1" multiline="true" id="condition-textbox"
|
||||
oninput="makeDirty()" onkeypress="onConditionKeyPress(event)"/>
|
||||
<textbox readonly="true" value="}"/>
|
||||
|
||||
<label value="&BPProps.Then.label;"/>
|
||||
<radiogroup id="result-radio" >
|
||||
<radio style="margin-left: 20px;" label="&BPProps.NeverStopRadio.label;"
|
||||
oncommand="makeDirty()"/>
|
||||
<radio style="margin-left: 20px;" label="&BPProps.AlwaysStopRadio.label;"
|
||||
oncommand="makeDirty()"/>
|
||||
<radio style="margin-left: 20px;"
|
||||
label="&BPProps.ConditionalBreakRadio.label;"
|
||||
oncommand="makeDirty()"/>
|
||||
<radio style="margin-left: 20px;"
|
||||
label="&BPProps.EarlyReturnRadio.label;"
|
||||
oncommand="makeDirty()"/>
|
||||
</radiogroup>
|
||||
|
||||
<hbox>
|
||||
<checkbox id="exception-checkbox"
|
||||
label="&BPProps.PassExceptionsCheck.label;"
|
||||
oncommand="makeDirty()"/>
|
||||
<checkbox id="log-checkbox"
|
||||
label="&BPProps.LogResultCheck.label;"
|
||||
oncommand="makeDirty()"/>
|
||||
</hbox>
|
||||
</groupbox>
|
||||
</vbox>
|
||||
|
||||
<hbox pack="end">
|
||||
<button id="apply-button" label="&BPProps.Apply.label;"
|
||||
oncommand="copyToBreakpoint();"/>
|
||||
<button id="revert-button" label="&BPProps.Revert.label;"
|
||||
oncommand="populateFromBreakpoint();"/>
|
||||
<button id="close-button" label="&BPProps.Close.label;"
|
||||
oncommand="close();"/>
|
||||
</hbox>
|
||||
|
||||
</window>
|
|
@ -46,6 +46,7 @@ function initCommands()
|
|||
[/* "real" commands */
|
||||
["about-mozilla", cmdAboutMozilla, 0],
|
||||
["break", cmdBreak, CMD_CONSOLE],
|
||||
["break-props", cmdBreakProps, CMD_CONSOLE],
|
||||
["chrome-filter", cmdChromeFilter, CMD_CONSOLE],
|
||||
["clear", cmdClear, CMD_CONSOLE],
|
||||
["clear-all", cmdClearAll, CMD_CONSOLE],
|
||||
|
@ -53,6 +54,7 @@ function initCommands()
|
|||
["clear-fbreak", cmdClearFBreak, 0],
|
||||
["clear-profile", cmdClearProfile, CMD_CONSOLE],
|
||||
["clear-script", cmdClearScript, 0],
|
||||
["clear-instance", cmdClearInstance, 0],
|
||||
["close", cmdClose, CMD_CONSOLE],
|
||||
["commands", cmdCommands, CMD_CONSOLE],
|
||||
["cont", cmdCont, CMD_CONSOLE | CMD_NEED_STACK],
|
||||
|
@ -101,8 +103,10 @@ function initCommands()
|
|||
["quit", cmdQuit, CMD_CONSOLE],
|
||||
["restore-layout", cmdRestoreLayout, CMD_CONSOLE],
|
||||
["release-notes", cmdReleaseNotes, 0],
|
||||
["run-to", cmdRunTo, CMD_NEED_STACK],
|
||||
["save-layout", cmdSaveLayout, CMD_CONSOLE],
|
||||
["save-profile", cmdSaveProfile, CMD_CONSOLE],
|
||||
["scan-source", cmdScanSource, 0],
|
||||
["scope", cmdScope, CMD_CONSOLE | CMD_NEED_STACK],
|
||||
["toggle-float", cmdToggleFloat, CMD_CONSOLE],
|
||||
["toggle-save-layout", cmdToggleSaveLayout, 0],
|
||||
|
@ -267,9 +271,17 @@ function cmdBreak (e)
|
|||
}
|
||||
}
|
||||
|
||||
function cmdBPProps (e)
|
||||
function cmdBreakProps (e)
|
||||
{
|
||||
dd ("command bp-props");
|
||||
if ("propsWindow" in e.breakWrapper)
|
||||
{
|
||||
e.breakWrapper.propsWindow.focus();
|
||||
return;
|
||||
}
|
||||
|
||||
e.breakWrapper.propsWindow =
|
||||
openDialog ("chrome://venkman/content/venkman-bpprops.xul", "",
|
||||
"chrome,extrachrome,menubar,resizable", e.breakWrapper);
|
||||
}
|
||||
|
||||
function cmdChromeFilter (e)
|
||||
|
@ -483,6 +495,25 @@ function cmdClearProfile (e)
|
|||
feedback (e, MSG_PROFILE_CLEARED);
|
||||
}
|
||||
|
||||
function cmdClearInstance (e)
|
||||
{
|
||||
if ("scriptInstanceList" in e)
|
||||
{
|
||||
for (var i = 0; i < e.scriptInstanceList.length; ++i)
|
||||
cmdClearInstance ({ scriptInstance: e.scriptInstanceList[i] });
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
if (e.scriptInstance.topLevel)
|
||||
e.scriptInstance.topLevel.clearBreakpoints();
|
||||
|
||||
for (var w in e.scriptInstance.functions)
|
||||
e.scriptInstance.functions[w].clearBreakpoints();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
function cmdClearScript (e)
|
||||
{
|
||||
var i;
|
||||
|
@ -565,6 +596,8 @@ function cmdEMode (e)
|
|||
MT_ERROR);
|
||||
return false;
|
||||
}
|
||||
|
||||
console.prefs["errorMode"] = console.errorMode;
|
||||
}
|
||||
|
||||
switch (console.errorMode)
|
||||
|
@ -895,14 +928,16 @@ function cmdFClearAll (e)
|
|||
if (!("isInteractive" in e))
|
||||
e.isInteractive = false;
|
||||
|
||||
var breakWrapperList = new Array()
|
||||
for (var i in console.breaks)
|
||||
breakWrapperList.push (console.breaks[i]);
|
||||
var breakWrapperList = new Array();
|
||||
|
||||
for (var i in console.fbreaks)
|
||||
breakWrapperList.push (console.fbreaks[i]);
|
||||
|
||||
if (breakWrapperList.length)
|
||||
{
|
||||
dispatch ("clear-fbreak", { isInteractive: e.isInteractive,
|
||||
breakWrapperList: breakWrapperList});
|
||||
breakWrapper: breakWrapperList[0],
|
||||
breakWrapperList: breakWrapperList });
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1117,7 +1152,7 @@ function cmdProps (e)
|
|||
var debuggerScope = (e.command.name == "propsd");
|
||||
|
||||
if (debuggerScope)
|
||||
v = evalInDebuggerScope (e.scriptText);
|
||||
v = console.jsds.wrapValue(evalInDebuggerScope (e.scriptText));
|
||||
else
|
||||
v = evalInTargetScope (e.scriptText);
|
||||
|
||||
|
@ -1181,6 +1216,17 @@ function cmdReleaseNotes (e)
|
|||
openTopWin(MSG_RELEASE_URL);
|
||||
}
|
||||
|
||||
function cmdRunTo (e)
|
||||
{
|
||||
if (!e.scriptWrapper.jsdScript.isValid)
|
||||
return;
|
||||
|
||||
var breakpoint = e.scriptWrapper.setBreakpoint(e.pc);
|
||||
if (breakpoint)
|
||||
breakpoint.oneTime = true;
|
||||
dispatch ("cont");
|
||||
}
|
||||
|
||||
function cmdSaveLayout (e)
|
||||
{
|
||||
if (!e.name)
|
||||
|
@ -1295,6 +1341,11 @@ function cmdSaveProfile (e)
|
|||
return file.localFile;
|
||||
}
|
||||
|
||||
function cmdScanSource (e)
|
||||
{
|
||||
e.scriptInstance.scanForMetaComments();
|
||||
}
|
||||
|
||||
function cmdScope ()
|
||||
{
|
||||
if (getCurrentFrame().scope.propertyCount == 0)
|
||||
|
@ -1496,6 +1547,8 @@ function cmdTMode (e)
|
|||
MT_ERROR);
|
||||
return false;
|
||||
}
|
||||
|
||||
console.prefs["throwMode"] = console.throwMode;
|
||||
}
|
||||
|
||||
switch (console.throwMode)
|
||||
|
@ -1522,7 +1575,26 @@ function cmdToggleFloat (e)
|
|||
return;
|
||||
}
|
||||
|
||||
dispatch ("move-view", { viewId: e.viewId, locationUrl: VMGR_VURL_NEW });
|
||||
var locationUrl;
|
||||
var view = console.views[e.viewId];
|
||||
var parsedLocation =
|
||||
console.viewManager.computeLocation(view.currentContent);
|
||||
|
||||
if (parsedLocation.windowId == VMGR_MAINWINDOW)
|
||||
{
|
||||
/* already in the main window, float the view. */
|
||||
locationUrl = VMGR_VURL_NEW
|
||||
}
|
||||
else
|
||||
{
|
||||
/* already floated, put it back. */
|
||||
if ("previousLocation" in view)
|
||||
locationUrl = view.previousLocation;
|
||||
else
|
||||
locationUrl = VMGR_VURL_GUTTER;
|
||||
}
|
||||
|
||||
dispatch ("move-view", { viewId: e.viewId, locationUrl: locationUrl });
|
||||
}
|
||||
|
||||
function cmdToggleSaveLayout (e)
|
||||
|
@ -1544,9 +1616,16 @@ function cmdToggleView (e)
|
|||
var url;
|
||||
|
||||
if ("currentContent" in view)
|
||||
{
|
||||
url = VMGR_VURL_HIDDEN;
|
||||
}
|
||||
else
|
||||
url = VMGR_VURL_NEW;
|
||||
{
|
||||
if ("previousLocation" in view)
|
||||
url = view.previousLocation;
|
||||
else
|
||||
url = VMGR_VURL_GUTTER;
|
||||
}
|
||||
|
||||
console.viewManager.moveViewURL (url, e.viewId);
|
||||
}
|
||||
|
|
|
@ -52,7 +52,6 @@ const TYPE_STRING = jsdIValue.TYPE_STRING;
|
|||
const TYPE_FUNCTION = jsdIValue.TYPE_FUNCTION;
|
||||
const TYPE_OBJECT = jsdIValue.TYPE_OBJECT;
|
||||
|
||||
|
||||
const PROP_ENUMERATE = jsdIProperty.FLAG_ENUMERATE;
|
||||
const PROP_READONLY = jsdIProperty.FLAG_READONLY;
|
||||
const PROP_PERMANENT = jsdIProperty.FLAG_PERMANENT;
|
||||
|
@ -71,16 +70,27 @@ const COLLECT_PROFILE_DATA = jsdIDebuggerService.COLLECT_PROFILE_DATA;
|
|||
const PCMAP_SOURCETEXT = jsdIScript.PCMAP_SOURCETEXT;
|
||||
const PCMAP_PRETTYPRINT = jsdIScript.PCMAP_PRETTYPRINT;
|
||||
|
||||
const RETURN_CONTINUE = jsdIExecutionHook.RETURN_CONTINUE;
|
||||
const RETURN_CONT_THROW = jsdIExecutionHook.RETURN_CONTINUE_THROW;
|
||||
const RETURN_VALUE = jsdIExecutionHook.RETURN_RET_WITH_VAL;
|
||||
const RETURN_THROW = jsdIExecutionHook.RETURN_THROW_WITH_VAL;
|
||||
|
||||
const FTYPE_STD = 0;
|
||||
const FTYPE_SUMMARY = 1;
|
||||
const FTYPE_ARRAY = 2;
|
||||
|
||||
const BREAKPOINT_STOPNEVER = 0;
|
||||
const BREAKPOINT_STOPALWAYS = 1;
|
||||
const BREAKPOINT_STOPTRUE = 2;
|
||||
const BREAKPOINT_EARLYRETURN = 3;
|
||||
|
||||
var $ = new Array(); /* array to store results from evals in debug frames */
|
||||
|
||||
function initDebugger()
|
||||
{
|
||||
dd ("initDebugger {");
|
||||
|
||||
|
||||
console.instanceSequence = 0;
|
||||
console._continueCodeStack = new Array(); /* top of stack is the default */
|
||||
/* return code for the most */
|
||||
/* recent debugTrap(). */
|
||||
|
@ -107,8 +117,8 @@ function initDebugger()
|
|||
console.jsds.errorHook = console.errorHook;
|
||||
console.jsds.flags = jsdIDebuggerService.ENABLE_NATIVE_FRAMES;
|
||||
|
||||
console.throwMode = TMODE_IGNORE;
|
||||
console.errorMode = EMODE_IGNORE;
|
||||
console.throwMode = console.prefs["throwMode"];
|
||||
console.errorMode = console.prefs["errorMode"];
|
||||
|
||||
var enumer = { enumerateScript: console.scriptHook.onScriptCreated };
|
||||
console.jsds.scriptHook = console.scriptHook;
|
||||
|
@ -121,7 +131,13 @@ function detachDebugger()
|
|||
{
|
||||
if ("frames" in console)
|
||||
console.jsds.exitNestedEventLoop();
|
||||
|
||||
|
||||
var b;
|
||||
for (b in console.breaks)
|
||||
console.breaks[b].clearBreakpoint();
|
||||
for (b in console.fbreaks)
|
||||
console.fbreaks[b].clearFutureBreakpoint();
|
||||
|
||||
console.jsds.topLevelHook = null;
|
||||
console.jsds.functionHook = null;
|
||||
console.jsds.breakpointHook = null;
|
||||
|
@ -327,7 +343,6 @@ function ScriptManager (url)
|
|||
this.instances = new Array();
|
||||
this.transients = new Object();
|
||||
this.transientCount = 0;
|
||||
this.instanceSequence = 0;
|
||||
this.disableTransients = isURLFiltered(url);
|
||||
}
|
||||
|
||||
|
@ -346,7 +361,7 @@ function smgr_created (jsdScript)
|
|||
{
|
||||
//dd ("instance created for " + jsdScript.fileName);
|
||||
instance = new ScriptInstance(this);
|
||||
instance.sequence = this.instanceSequence++;
|
||||
instance.sequence = console.instanceSequence++;
|
||||
this.instances.push(instance);
|
||||
dispatchCommand (console.coInstanceCreated,
|
||||
{ scriptInstance: instance });
|
||||
|
@ -533,6 +548,55 @@ function ScriptInstance (manager)
|
|||
this._lineMapInited = false;
|
||||
}
|
||||
|
||||
ScriptInstance.prototype.scanForMetaComments =
|
||||
function si_scan (start)
|
||||
{
|
||||
const CHUNK_SIZE = 500;
|
||||
const CHUNK_DELAY = 100;
|
||||
|
||||
var scriptInstance = this;
|
||||
var sourceText = this.sourceText;
|
||||
|
||||
function onSourceLoaded(result)
|
||||
{
|
||||
if (result == Components.results.NS_OK)
|
||||
scriptInstance.scanForMetaComments();
|
||||
};
|
||||
|
||||
if (!sourceText.isLoaded)
|
||||
{
|
||||
sourceText.loadSource(onSourceLoaded);
|
||||
return;
|
||||
}
|
||||
|
||||
if (typeof start == "undefined")
|
||||
start = 0;
|
||||
|
||||
var end = Math.min (sourceText.lines.length, start + CHUNK_SIZE);
|
||||
var obj = new Object();
|
||||
|
||||
for (var i = start; i < end; ++i)
|
||||
{
|
||||
var ary = sourceText.lines[i].match (/\/\/@(\S+)(.*)/);
|
||||
if (ary && ary[1] in console.metaDirectives && !(ary[1] in obj))
|
||||
{
|
||||
try
|
||||
{
|
||||
console.metaDirectives[ary[1]](scriptInstance, i + 1, ary);
|
||||
}
|
||||
catch (ex)
|
||||
{
|
||||
display (getMsg(MSN_ERR_META_FAILED, [ary[1], this.url, i + 1]),
|
||||
MT_ERROR);
|
||||
display (formatException (ex), MT_ERROR);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (i != sourceText.lines.length)
|
||||
setTimeout (this.scanForMetaComments, CHUNK_DELAY, i);
|
||||
}
|
||||
|
||||
ScriptInstance.prototype.seal =
|
||||
function si_seal ()
|
||||
{
|
||||
|
@ -728,6 +792,40 @@ function si_setbp (line)
|
|||
return found;
|
||||
}
|
||||
|
||||
ScriptInstance.prototype.getScriptWrapperAtLine =
|
||||
function si_getscript (line)
|
||||
{
|
||||
var targetScript = null;
|
||||
var scriptWrapper;
|
||||
|
||||
if (this.topLevel)
|
||||
{
|
||||
scriptWrapper = this.topLevel;
|
||||
if (line >= scriptWrapper.jsdScript.baseLineNumber &&
|
||||
line <= scriptWrapper.jsdScript.baseLineNumber +
|
||||
scriptWrapper.jsdScript.lineExtent)
|
||||
{
|
||||
targetScript = scriptWrapper;
|
||||
}
|
||||
}
|
||||
|
||||
for (var f in this.functions)
|
||||
{
|
||||
scriptWrapper = this.functions[f];
|
||||
if ((line >= scriptWrapper.jsdScript.baseLineNumber &&
|
||||
line <= scriptWrapper.jsdScript.baseLineNumber +
|
||||
scriptWrapper.jsdScript.lineExtent) &&
|
||||
(!targetScript ||
|
||||
scriptWrapper.jsdScript.lineExtent <
|
||||
targetScript.jsdScript.lineExtent))
|
||||
{
|
||||
targetScript = scriptWrapper;
|
||||
}
|
||||
}
|
||||
|
||||
return targetScript;
|
||||
}
|
||||
|
||||
ScriptInstance.prototype.containsScriptTag =
|
||||
function si_contains (tag)
|
||||
{
|
||||
|
@ -830,6 +928,16 @@ function sw_hasbp (pc)
|
|||
return key in console.breaks;
|
||||
}
|
||||
|
||||
ScriptWrapper.prototype.getBreakpoint =
|
||||
function sw_hasbp (pc)
|
||||
{
|
||||
var key = this.jsdScript.tag + ":" + pc;
|
||||
if (key in console.breaks)
|
||||
return console.breaks[key];
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
ScriptWrapper.prototype.setBreakpoint =
|
||||
function sw_setbp (pc, parentBP)
|
||||
{
|
||||
|
@ -838,7 +946,7 @@ function sw_setbp (pc, parentBP)
|
|||
//dd ("setting breakpoint in " + this.functionName + " " + key);
|
||||
|
||||
if (key in console.breaks)
|
||||
return false;
|
||||
return null;
|
||||
|
||||
var brk = new BreakInstance (parentBP, this, pc);
|
||||
console.breaks[key] = brk;
|
||||
|
@ -868,9 +976,7 @@ function sw_setbp (pc, parentBP)
|
|||
|
||||
dispatch ("hook-break-set", { breakWrapper: brk });
|
||||
|
||||
this.jsdScript.setBreakpoint (pc);
|
||||
|
||||
return true;
|
||||
return brk;
|
||||
}
|
||||
|
||||
ScriptWrapper.prototype.clearBreakpoints =
|
||||
|
@ -893,6 +999,9 @@ function sw_clearbp (pc)
|
|||
|
||||
var brk = console.breaks[key];
|
||||
|
||||
if ("propsWindow" in brk)
|
||||
brk.propsWindow.close();
|
||||
|
||||
delete console.breaks[key];
|
||||
delete this.breaks[key];
|
||||
|
||||
|
@ -969,9 +1078,136 @@ function getScriptWrapper(jsdScript)
|
|||
|
||||
function BreakInstance (parentBP, scriptWrapper, pc)
|
||||
{
|
||||
this._enabled = true;
|
||||
this.parentBP = parentBP;
|
||||
this.scriptWrapper = scriptWrapper;
|
||||
this.pc = pc;
|
||||
this.url = scriptWrapper.jsdScript.fileName;
|
||||
this.lineNumber = scriptWrapper.jsdScript.pcToLine (pc, PCMAP_SOURCETEXT);
|
||||
this.oneTime = false;
|
||||
this.triggerCount = 0;
|
||||
|
||||
scriptWrapper.jsdScript.setBreakpoint (pc);
|
||||
}
|
||||
|
||||
BreakInstance.prototype.clearBreakpoint =
|
||||
function bi_clear()
|
||||
{
|
||||
this.scriptWrapper.clearBreakpoint(this.pc);
|
||||
}
|
||||
|
||||
BreakInstance.prototype.__defineGetter__ ("enabled", bi_getEnabled);
|
||||
function bi_getEnabled ()
|
||||
{
|
||||
return this._enabled;
|
||||
}
|
||||
|
||||
BreakInstance.prototype.__defineSetter__ ("enabled", bi_setEnabled);
|
||||
function bi_setEnabled (state)
|
||||
{
|
||||
if (state != this._enabled)
|
||||
{
|
||||
this._enabled = state;
|
||||
if (state)
|
||||
this.jsdScript.setBreakpoint(pc);
|
||||
else
|
||||
this.jsdScript.clearBreakpoint(pc);
|
||||
}
|
||||
|
||||
return state;
|
||||
}
|
||||
|
||||
BreakInstance.prototype.__defineGetter__ ("conditionEnabled", bi_getCondEnabled);
|
||||
function bi_getCondEnabled ()
|
||||
{
|
||||
if ("_conditionEnabled" in this)
|
||||
return this._conditionEnabled;
|
||||
|
||||
if (this.parentBP)
|
||||
return this.parentBP.conditionEnabled;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
BreakInstance.prototype.__defineSetter__ ("conditionEnabled", bi_setCondEnabled);
|
||||
function bi_setCondEnabled (state)
|
||||
{
|
||||
return this._conditionEnabled = state;
|
||||
}
|
||||
|
||||
BreakInstance.prototype.__defineGetter__ ("condition", bi_getCondition);
|
||||
function bi_getCondition ()
|
||||
{
|
||||
if ("_condition" in this)
|
||||
return this._condition;
|
||||
|
||||
if (this.parentBP)
|
||||
return this.parentBP.condition;
|
||||
|
||||
return "";
|
||||
}
|
||||
|
||||
BreakInstance.prototype.__defineSetter__ ("condition", bi_setCondition);
|
||||
function bi_setCondition (value)
|
||||
{
|
||||
return this._condition = value;
|
||||
}
|
||||
|
||||
|
||||
BreakInstance.prototype.__defineGetter__ ("passExceptions", bi_getException);
|
||||
function bi_getException ()
|
||||
{
|
||||
if ("_passExceptions" in this)
|
||||
return this._passExceptions;
|
||||
|
||||
if (this.parentBP)
|
||||
return this.parentBP.passExceptions;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
BreakInstance.prototype.__defineSetter__ ("passExceptions", bi_setException);
|
||||
function bi_setException (state)
|
||||
{
|
||||
return this._passExceptions = state;
|
||||
}
|
||||
|
||||
|
||||
BreakInstance.prototype.__defineGetter__ ("logResult", bi_getLogResult);
|
||||
function bi_getLogResult ()
|
||||
{
|
||||
if ("_logResult" in this)
|
||||
return this._logResult;
|
||||
|
||||
if (this.parentBP)
|
||||
return this.parentBP.logResult;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
BreakInstance.prototype.__defineSetter__ ("logResult", bi_setLogResult);
|
||||
function bi_setLogResult (state)
|
||||
{
|
||||
return this._logResult = state;
|
||||
}
|
||||
|
||||
|
||||
BreakInstance.prototype.__defineGetter__ ("resultAction", bi_getResultAction);
|
||||
function bi_getResultAction ()
|
||||
{
|
||||
if ("_resultAction" in this)
|
||||
return this._resultAction;
|
||||
|
||||
if (this.parentBP)
|
||||
return this.parentBP.resultAction;
|
||||
|
||||
return BREAKPOINT_STOPALWAYS;
|
||||
}
|
||||
|
||||
BreakInstance.prototype.__defineSetter__ ("resultAction", bi_setResultAction);
|
||||
function bi_setResultAction (state)
|
||||
{
|
||||
return this._resultAction = state;
|
||||
}
|
||||
|
||||
function FutureBreakpoint (url, lineNumber)
|
||||
|
@ -979,12 +1215,22 @@ function FutureBreakpoint (url, lineNumber)
|
|||
this.url = url;
|
||||
this.lineNumber = lineNumber;
|
||||
this.enabled = true;
|
||||
this.scriptText = null;
|
||||
this.childrenBP = new Object;
|
||||
this.conditionEnabled = false;
|
||||
this.condition = "";
|
||||
this.passExceptions = false;
|
||||
this.logResult = false;
|
||||
this.resultAction = BREAKPOINT_STOPALWAYS;
|
||||
}
|
||||
|
||||
FutureBreakpoint.prototype.clearFutureBreakpoint =
|
||||
function fb_clear ()
|
||||
{
|
||||
clearFutureBreakpoint (this.url, this.lineNumber);
|
||||
}
|
||||
|
||||
FutureBreakpoint.prototype.resetInstances =
|
||||
function fb_reset ()
|
||||
function fb_reseti ()
|
||||
{
|
||||
for (var url in console.scriptManagers)
|
||||
{
|
||||
|
@ -994,7 +1240,7 @@ function fb_reset ()
|
|||
}
|
||||
|
||||
FutureBreakpoint.prototype.clearInstances =
|
||||
function fb_clear ()
|
||||
function fb_cleari ()
|
||||
{
|
||||
for (var url in console.scriptManagers)
|
||||
{
|
||||
|
@ -1003,6 +1249,73 @@ function fb_clear ()
|
|||
}
|
||||
}
|
||||
|
||||
function testBreakpoint(currentFrame, rv)
|
||||
{
|
||||
var tag = currentFrame.script.tag;
|
||||
if (!(tag in console.scriptWrappers))
|
||||
return -1;
|
||||
|
||||
var scriptWrapper = console.scriptWrappers[tag];
|
||||
var breakpoint = scriptWrapper.getBreakpoint(currentFrame.pc);
|
||||
if (!ASSERT(breakpoint, "can't find breakpoint for " +
|
||||
formatFrame(currentFrame)))
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
++breakpoint.triggerCount;
|
||||
if ("propsWindow" in breakpoint)
|
||||
breakpoint.propsWindow.onBreakpointTriggered();
|
||||
|
||||
if (breakpoint.oneTime)
|
||||
scriptWrapper.clearBreakpoint(currentFrame.pc);
|
||||
|
||||
if (breakpoint.conditionEnabled && breakpoint.condition)
|
||||
{
|
||||
var result = new Object();
|
||||
var script = "var __trigger__ = function (__count__) {" +
|
||||
breakpoint.condition + "}; __trigger__.apply(this, [" +
|
||||
breakpoint.triggerCount + "]);";
|
||||
if (!currentFrame.eval (script,
|
||||
JSD_URL_SCHEME + "breakpoint-condition",
|
||||
1, result))
|
||||
{
|
||||
/* condition raised an exception */
|
||||
if (breakpoint.passExceptions)
|
||||
{
|
||||
rv.value = result.value;
|
||||
return RETURN_THROW;
|
||||
}
|
||||
|
||||
display (MSG_ERR_CONDITION_FAILED, MT_ERROR);
|
||||
display (formatException(result.value.getWrappedValue()), MT_ERROR);
|
||||
}
|
||||
else
|
||||
{
|
||||
/* condition executed ok */
|
||||
if (breakpoint.logResult)
|
||||
{
|
||||
display (result.value.stringValue, MT_LOG);
|
||||
}
|
||||
|
||||
if (breakpoint.resultAction == BREAKPOINT_EARLYRETURN)
|
||||
{
|
||||
rv.value = result.value;
|
||||
return RETURN_VALUE;
|
||||
}
|
||||
|
||||
if (breakpoint.resultAction == BREAKPOINT_STOPNEVER ||
|
||||
(breakpoint.resultAction == BREAKPOINT_STOPTRUE &&
|
||||
!result.value.booleanValue))
|
||||
{
|
||||
return RETURN_CONTINUE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
const EMODE_IGNORE = 0;
|
||||
const EMODE_TRACE = 1;
|
||||
const EMODE_BREAK = 2;
|
||||
|
@ -1021,6 +1334,9 @@ function debugTrap (frame, type, rv)
|
|||
switch (type)
|
||||
{
|
||||
case jsdIExecutionHook.TYPE_BREAKPOINT:
|
||||
var bpResult = testBreakpoint(frame, rv);
|
||||
if (bpResult != -1)
|
||||
return bpResult;
|
||||
tn = MSG_VAL_BREAKPOINT;
|
||||
break;
|
||||
case jsdIExecutionHook.TYPE_DEBUG_REQUESTED:
|
||||
|
@ -1463,6 +1779,9 @@ function clearFutureBreakpoint (urlPattern, lineNumber)
|
|||
|
||||
var i;
|
||||
var fbreak = console.fbreaks[key];
|
||||
if ("propsWindow" in fbreak)
|
||||
fbreak.propsWindow.close();
|
||||
|
||||
delete console.fbreaks[key];
|
||||
|
||||
for (i in fbreak.childrenBP)
|
||||
|
|
|
@ -49,14 +49,14 @@ function onLoad()
|
|||
|
||||
windowId = ary[1];
|
||||
|
||||
if (console.prefs["menubarInFloaters"])
|
||||
console.createMainMenu (window.document);
|
||||
|
||||
if ("arguments" in window && 0 in window.arguments &&
|
||||
typeof window.arguments[0] == "function")
|
||||
{
|
||||
window.arguments[0](window);
|
||||
}
|
||||
|
||||
if (console.prefs["menubarInFloaters"])
|
||||
console.createMainMenu (window.document);
|
||||
}
|
||||
|
||||
function onClose()
|
||||
|
|
|
@ -148,8 +148,10 @@
|
|||
<statusbarpanel id="component-bar"/>
|
||||
<statusbarpanel id="status-text" label="" flex="1"
|
||||
crop="right"/>
|
||||
<!--
|
||||
<statusbarpanel class="statusbarpanel-iconic" id="offline-status"
|
||||
hidden="true" offline="true"/>
|
||||
-->
|
||||
</statusbar>
|
||||
</overlaytarget>
|
||||
|
||||
|
|
|
@ -142,6 +142,7 @@ const MT_SOURCE = "SOURCE";
|
|||
const MT_STEP = "STEP";
|
||||
const MT_STOP = "STOP";
|
||||
const MT_ETRACE = "ETRACE";
|
||||
const MT_LOG = "LOG";
|
||||
const MT_USAGE = "USAGE";
|
||||
const MT_EVAL_IN = "EVAL-IN";
|
||||
const MT_EVAL_OUT = "EVAL-OUT";
|
||||
|
|
|
@ -89,8 +89,10 @@ function mng_munge (text, containerTag, data)
|
|||
text = String(text);
|
||||
|
||||
if (!containerTag)
|
||||
{
|
||||
containerTag =
|
||||
document.createElementNS (NS_XHTML, this.tagName);
|
||||
}
|
||||
|
||||
if (this.enabled)
|
||||
{
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
|
||||
/* -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License
|
||||
* Version 1.1 (the "License"); you may not use this file except in
|
||||
|
@ -67,6 +67,10 @@ a.venkman-link:hover {
|
|||
font-weight: bold;
|
||||
}
|
||||
|
||||
.msg-data[msg-type="LOG"]:before {
|
||||
content: "LOG:";
|
||||
}
|
||||
|
||||
.msg-data[msg-type="ERROR"]:before {
|
||||
content: "!!";
|
||||
}
|
||||
|
|
|
@ -63,6 +63,9 @@ function initPrefs()
|
|||
console.addPref ("statusDuration", 5 * 1000);
|
||||
console.addPref ("menubarInFloaters",
|
||||
navigator.platform.indexOf ("Mac") != -1);
|
||||
console.addPref ("errorMode", EMODE_IGNORE);
|
||||
console.addPref ("throwMode", TMODE_IGNORE);
|
||||
|
||||
var list = console.prefs.prefBranch.getChildList("", {});
|
||||
for (var p in list)
|
||||
{
|
||||
|
|
|
@ -156,9 +156,14 @@ function WindowRecord (win, baseURL)
|
|||
if (this.url.search(/^\w+:/) == -1)
|
||||
{
|
||||
if (this.url[0] == "/")
|
||||
this.url = win.location.host + this.url;
|
||||
{
|
||||
this.url = win.location.protocol + "//" + win.location.host +
|
||||
this.url;
|
||||
}
|
||||
else
|
||||
{
|
||||
this.url = baseURL + this.url;
|
||||
}
|
||||
this.baseURL = baseURL;
|
||||
}
|
||||
else
|
||||
|
@ -225,6 +230,7 @@ function fcr_getkids ()
|
|||
|
||||
this.childData = new Array();
|
||||
var doc = this.windowRecord.window.document;
|
||||
var loc = this.windowRecord.window.location;
|
||||
var nodeList = doc.getElementsByTagName("script");
|
||||
dd (nodeList.length + "nodes");
|
||||
for (var i = 0; i < nodeList.length; ++i)
|
||||
|
@ -233,7 +239,17 @@ function fcr_getkids ()
|
|||
if (url)
|
||||
{
|
||||
if (url.search(/^\w+:/) == -1)
|
||||
url = getPathFromURL (this.windowRecord.url) + url;
|
||||
{
|
||||
if (url[0] == "/")
|
||||
url = loc.protocol + "//" + loc.host + url;
|
||||
else
|
||||
url = this.windowRecord.baseURL + url;
|
||||
}
|
||||
else
|
||||
{
|
||||
this.baseURL = getPathFromURL(this.url);
|
||||
}
|
||||
|
||||
this.appendChild(new FileRecord(url));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -55,6 +55,7 @@
|
|||
<script src="chrome://global/content/nsDragAndDrop.js"/>
|
||||
<script src="chrome://communicator/content/contentAreaUtils.js"/>
|
||||
<script src="chrome://communicator/content/contentAreaDD.js"/>
|
||||
<script src="chrome://communicator/content/findUtils.js"/>
|
||||
<script src="chrome://global/content/strres.js"/>
|
||||
|
||||
<script src="chrome://venkman/content/command-manager.js"/>
|
||||
|
|
|
@ -33,7 +33,7 @@
|
|||
*
|
||||
*/
|
||||
|
||||
const __vnk_version = "0.9.24";
|
||||
const __vnk_version = "0.9.28";
|
||||
const __vnk_requiredLocale = "0.9.x";
|
||||
var __vnk_versionSuffix = "";
|
||||
|
||||
|
@ -222,36 +222,27 @@ function dispatchCommand (command, e, flags)
|
|||
var names, hooks;
|
||||
|
||||
if (isBefore)
|
||||
{
|
||||
names = command.beforeHookNames;
|
||||
hooks = command.beforeHooks;
|
||||
}
|
||||
else
|
||||
{
|
||||
names = command.afterHookNames;
|
||||
hooks = command.afterHooks;
|
||||
}
|
||||
|
||||
var len = names.length;
|
||||
|
||||
for (var i = 0; i < len; ++i)
|
||||
for (var h in hooks)
|
||||
{
|
||||
var name = names[i];
|
||||
if ("dbgDispatch" in console && console.dbgDispatch)
|
||||
{
|
||||
dd ("calling " + (isBefore ? "before" : "after") +
|
||||
" hook " + name);
|
||||
" hook " + h);
|
||||
}
|
||||
try
|
||||
{
|
||||
hooks[name](e);
|
||||
hooks[h](e);
|
||||
}
|
||||
catch (ex)
|
||||
{
|
||||
display (getMsg(MSN_ERR_INTERNAL_HOOK, name), MT_ERROR);
|
||||
display (getMsg(MSN_ERR_INTERNAL_HOOK, h), MT_ERROR);
|
||||
display (formatException(ex), MT_ERROR);
|
||||
dd (formatException(ex), MT_ERROR);
|
||||
if ("stack" in ex)
|
||||
if (typeof ex == "object" && "stack" in ex)
|
||||
dd (ex.stack);
|
||||
}
|
||||
}
|
||||
|
@ -534,7 +525,7 @@ function destroy ()
|
|||
{
|
||||
if (console.prefs["saveLayoutOnExit"])
|
||||
dispatch ("save-layout default");
|
||||
|
||||
|
||||
destroyViews();
|
||||
destroyHandlers();
|
||||
detachDebugger();
|
||||
|
@ -609,7 +600,8 @@ function hookScriptSealed (e)
|
|||
{
|
||||
for (var fbp in console.fbreaks)
|
||||
{
|
||||
if (e.scriptInstance.url.search(console.fbreaks[fbp].url) != -1)
|
||||
if (console.fbreaks[fbp].enabled &&
|
||||
e.scriptInstance.url.search(console.fbreaks[fbp].url) != -1)
|
||||
{
|
||||
e.scriptInstance.setBreakpoint(console.fbreaks[fbp].lineNumber,
|
||||
console.fbreaks[fbp]);
|
||||
|
@ -735,6 +727,59 @@ console.display = display;
|
|||
console.dispatch = dispatch;
|
||||
console.dispatchCommand = dispatchCommand;
|
||||
|
||||
console.metaDirectives = new Object();
|
||||
|
||||
console.metaDirectives["JSD_LOG"] =
|
||||
console.metaDirectives["JSD_BREAK"] =
|
||||
console.metaDirectives["JSD_EVAL"] =
|
||||
function metaBreak (scriptInstance, line, matchResult)
|
||||
{
|
||||
var scriptWrapper = scriptInstance.getScriptWrapperAtLine(line);
|
||||
if (!scriptWrapper)
|
||||
{
|
||||
display (getMsg(MSN_ERR_NO_FUNCTION, [line, scriptInstance.url]),
|
||||
MT_ERROR);
|
||||
return;
|
||||
}
|
||||
|
||||
var pc = scriptWrapper.jsdScript.lineToPc(line, PCMAP_SOURCETEXT);
|
||||
if (scriptWrapper.getBreakpoint(pc))
|
||||
return;
|
||||
|
||||
var breakpoint = scriptWrapper.setBreakpoint (pc);
|
||||
matchResult[2] = stringTrim(matchResult[2]);
|
||||
|
||||
switch (matchResult[1])
|
||||
{
|
||||
case "JSD_LOG":
|
||||
breakpoint.conditionEnabled = true;
|
||||
breakpoint.condition = "return eval(" + matchResult[2].quote() + ")";
|
||||
breakpoint.resultAction = BREAKPOINT_STOPNEVER;
|
||||
breakpoint.logResult = true;
|
||||
break;
|
||||
|
||||
case "JSD_BREAK":
|
||||
if (matchResult[2])
|
||||
{
|
||||
breakpoint.conditionEnabled = true;
|
||||
breakpoint.condition = "return eval(" + matchResult[2].quote() +
|
||||
")";
|
||||
breakpoint.resultAction = BREAKPOINT_STOPTRUE;
|
||||
}
|
||||
else
|
||||
{
|
||||
breakpoint.resultAction = BREAKPOINT_STOPALWAYS;
|
||||
}
|
||||
break;
|
||||
|
||||
case "JSD_EVAL":
|
||||
breakpoint.conditionEnabled = true;
|
||||
breakpoint.condition = "return eval(" + matchResult[2].quote() + ")";
|
||||
breakpoint.resultAction = BREAKPOINT_STOPNEVER;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
console.__defineGetter__ ("status", con_getstatus);
|
||||
function con_getstatus ()
|
||||
{
|
||||
|
@ -796,391 +841,6 @@ function con_popstatus ()
|
|||
console.status = console._statusStack[console._statusStack.length - 1];
|
||||
}
|
||||
|
||||
function createDOMForSourceText (sourceText, container)
|
||||
{
|
||||
if (!ASSERT(sourceText.isLoaded, "sourceText is not loaded"))
|
||||
return;
|
||||
|
||||
var document = container.ownerDocument;
|
||||
if (!ASSERT(document, "container has no owner document, using default"))
|
||||
document = window.document
|
||||
|
||||
var sourceContainer = document.createElement ("source-listing");
|
||||
|
||||
const COMMENT = 0;
|
||||
const STRING1 = 1;
|
||||
const STRING2 = 2;
|
||||
const WORD = 3;
|
||||
const NUMBER = 4;
|
||||
const OTHER = 5;
|
||||
|
||||
var keywords = {
|
||||
"abstract": 1, "boolean": 1, "break": 1, "byte": 1, "case": 1,
|
||||
"catch": 1, "char": 1, "class": 1, "const": 1, "continue": 1,
|
||||
"debugger": 1, "default": 1, "delete": 1, "do": 1, "double": 1,
|
||||
"else": 1, "enum": 1, "export": 1, "export": 1, "extends": 1,
|
||||
"false": 1, "final": 1, "finally": 1, "float": 1, "for": 1,
|
||||
"function": 1, "goto": 1, "if": 1, "implements": 1, "import": 1,
|
||||
"in": 1, "instanceof": 1, "int": 1, "interface": 1, "long": 1,
|
||||
"native": 1, "new": 1, "null": 1, "package": 1, "private": 1,
|
||||
"protected": 1, "public": 1, "return": 1, "short": 1, "static": 1,
|
||||
"switch": 1, "synchronized": 1, "this": 1, "throw": 1, "throws": 1,
|
||||
"transient": 1, "true": 1, "try": 1, "typeof": 1, "var": 1, "void": 1,
|
||||
"while": 1, "with": 1
|
||||
};
|
||||
|
||||
function mungeLine (line, parentNode, previousState, previousNode)
|
||||
{
|
||||
if (!previousState)
|
||||
previousState = OTHER;
|
||||
|
||||
function closePhrase (phrase)
|
||||
{
|
||||
/* put |phrase| into a DOM node, and append that node to
|
||||
* |sourceContainer|. If |phrase| is the same type as the
|
||||
* |previousNode|, insert it there instead. */
|
||||
if (!phrase)
|
||||
{
|
||||
previousState = OTHER;
|
||||
return;
|
||||
}
|
||||
|
||||
var textNode = document.createTextNode (phrase);
|
||||
var nodeName;
|
||||
|
||||
switch (previousState)
|
||||
{
|
||||
case COMMENT:
|
||||
nodeName = "c";
|
||||
break;
|
||||
case STRING1:
|
||||
case STRING2:
|
||||
nodeName = "s";
|
||||
break;
|
||||
case WORD:
|
||||
if (phrase in keywords)
|
||||
nodeName = "k";
|
||||
else
|
||||
nodeName = "w";
|
||||
break;
|
||||
case NUMBER:
|
||||
case OTHER:
|
||||
parentNode.appendChild (textNode);
|
||||
previousState = OTHER;
|
||||
previousNode = null;
|
||||
return;
|
||||
}
|
||||
|
||||
if (previousNode && previousNode.localName == nodeName)
|
||||
{
|
||||
previousNode.appendChild (textNode);
|
||||
}
|
||||
else
|
||||
{
|
||||
previousNode = document.createElement (nodeName);
|
||||
previousNode.appendChild (textNode);
|
||||
parentNode.appendChild (previousNode);
|
||||
}
|
||||
|
||||
previousState = OTHER;
|
||||
return;
|
||||
};
|
||||
|
||||
var pos;
|
||||
var ch, ch2;
|
||||
var expr;
|
||||
|
||||
while (line.length > 0)
|
||||
{
|
||||
/* scan a line of text. |pos| always one *past* the end of the
|
||||
* phrase we just scanned. */
|
||||
|
||||
switch (previousState)
|
||||
{
|
||||
case COMMENT:
|
||||
/* look for the end of a slash-star comment,
|
||||
* slash-slash comments are handled down below, because
|
||||
* we know for sure that it's the last phrase on this line.
|
||||
*/
|
||||
pos = line.search (/\*\//);
|
||||
if (pos != -1)
|
||||
pos += 2;
|
||||
break;
|
||||
|
||||
case STRING1:
|
||||
case STRING2:
|
||||
/* look for the end of a single or double quoted string. */
|
||||
if (previousState == STRING1)
|
||||
{
|
||||
ch = "'";
|
||||
expr = /\'/;
|
||||
}
|
||||
else
|
||||
{
|
||||
ch = "\"";
|
||||
expr = /\"/;
|
||||
}
|
||||
|
||||
if (line[0] == ch)
|
||||
{
|
||||
pos = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
pos = line.search (expr);
|
||||
if (pos > 0 && line[pos - 1] == "\\")
|
||||
{
|
||||
/* arg, the quote we found was escaped, fall back
|
||||
* to scanning a character at a time. */
|
||||
var done = false;
|
||||
for (pos = 0; !done && pos < line.length; ++pos)
|
||||
{
|
||||
if (line[pos] == "\\")
|
||||
++pos;
|
||||
else if (line[pos] == ch)
|
||||
done = true;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
/* no slash before the end quote, it *must* be
|
||||
* the end of the string. */
|
||||
if (pos != -1)
|
||||
++pos;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case WORD:
|
||||
/* look for the end of something that qualifies as
|
||||
* an identifier. */
|
||||
var wordPattern = /[^a-zA-Z0-9_\$]/;
|
||||
pos = line.search(wordPattern);
|
||||
while (pos > -1 && line[pos] == "\\")
|
||||
{
|
||||
/* if we ended with a \ character, then the slash
|
||||
* and the character after it are part of this word.
|
||||
* the characters following may also be part of the
|
||||
* word. */
|
||||
pos += 2;
|
||||
var newPos = line.substr(pos).search(wordPattern);
|
||||
if (newPos > -1)
|
||||
pos += newPos;
|
||||
}
|
||||
break;
|
||||
|
||||
case NUMBER:
|
||||
/* look for the end of a number */
|
||||
pos = line.search (/[^0-9\.]/);
|
||||
break;
|
||||
|
||||
case OTHER:
|
||||
/* look for the end of anything else, like whitespace
|
||||
* or operators. */
|
||||
pos = line.search (/[0-9a-zA-Z_\$\"\']|\\|\/\/|\/\*/);
|
||||
break;
|
||||
}
|
||||
|
||||
if (pos == -1)
|
||||
{
|
||||
/* couldn't find an end for the current state, close out the
|
||||
* rest of the line.
|
||||
*/
|
||||
if (previousState == COMMENT || previousState == STRING1 ||
|
||||
previousState == STRING2)
|
||||
{
|
||||
var savedState = previousState;
|
||||
closePhrase(line);
|
||||
previousState = savedState;
|
||||
}
|
||||
else
|
||||
{
|
||||
closePhrase(line);
|
||||
}
|
||||
|
||||
line = "";
|
||||
}
|
||||
else
|
||||
{
|
||||
/* pos has a non -1 value, close out what we found, and move
|
||||
* along. */
|
||||
if (previousState == STRING1 || previousState == STRING2)
|
||||
{
|
||||
/* strings are a special case because they actually are
|
||||
* considered to start *after* the leading quote,
|
||||
* and they end *before* the trailing quote. */
|
||||
if (pos == 1)
|
||||
{
|
||||
/* empty string */
|
||||
previousState = OTHER;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* non-empty string, close out the contents of the
|
||||
* string. */
|
||||
closePhrase(line.substr (0, pos - 1));
|
||||
}
|
||||
|
||||
/* close the trailing quote. */
|
||||
closePhrase (line[pos - 1]);
|
||||
}
|
||||
else
|
||||
{
|
||||
/* non-string phrase, close the whole deal. */
|
||||
closePhrase(line.substr (0, pos));
|
||||
}
|
||||
|
||||
if (pos)
|
||||
{
|
||||
/* continue on with the rest of the line */
|
||||
line = line.substr (pos);
|
||||
}
|
||||
}
|
||||
|
||||
if (line)
|
||||
{
|
||||
/* figure out what the next token looks like. */
|
||||
ch = line[0];
|
||||
ch2 = (line.length > 1) ? line[1] : "";
|
||||
|
||||
if (ch == "/" && ch2 == "/")
|
||||
{
|
||||
/* slash-slash comment, the last thing on this line. */
|
||||
previousState = COMMENT;
|
||||
closePhrase(line);
|
||||
line = "";
|
||||
}
|
||||
else if (ch == "'")
|
||||
{
|
||||
closePhrase("'");
|
||||
line = line.substr(1);
|
||||
previousState = STRING1;
|
||||
}
|
||||
else if (ch == "\"")
|
||||
{
|
||||
closePhrase("\"");
|
||||
line = line.substr(1);
|
||||
previousState = STRING2;
|
||||
}
|
||||
else if (ch == "/" && ch2 == "*")
|
||||
{
|
||||
previousState = COMMENT;
|
||||
}
|
||||
else if (ch.search (/[a-zA-Z_\\\$]/) == 0)
|
||||
{
|
||||
previousState = WORD;
|
||||
}
|
||||
else if (ch.search (/[0-9]/) == 0)
|
||||
{
|
||||
previousState = NUMBER;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
parentNode.appendChild (document.createTextNode ("\n"));
|
||||
|
||||
return { previousState: previousState, previousNode: previousNode };
|
||||
};
|
||||
|
||||
function processMarginChunk (start, callback, margin)
|
||||
{
|
||||
/* build a chunk of the left margin. */
|
||||
dd ("processMarginChunk " + start + " {");
|
||||
const CHUNK_SIZE = 500;
|
||||
const CHUNK_DELAY = 100;
|
||||
|
||||
if (!margin)
|
||||
{
|
||||
margin = document.createElement ("left-margin");
|
||||
sourceContainer.appendChild (margin);
|
||||
}
|
||||
|
||||
var stop = Math.min (sourceText.lines.length, start + CHUNK_SIZE);
|
||||
var element;
|
||||
for (var i = start; i < stop; ++i)
|
||||
{
|
||||
element = document.createElement ("num");
|
||||
if ("lineMap" in sourceText && i in sourceText.lineMap &&
|
||||
(sourceText.lineMap[i] & LINE_BREAKABLE))
|
||||
{
|
||||
element.setAttribute ("x", "t");
|
||||
}
|
||||
|
||||
element.appendChild (document.createTextNode(i));
|
||||
margin.appendChild (element);
|
||||
}
|
||||
|
||||
if (i != sourceText.lines.length)
|
||||
{
|
||||
setTimeout (processMarginChunk, CHUNK_DELAY, i, callback,
|
||||
margin);
|
||||
}
|
||||
else
|
||||
{
|
||||
callback();
|
||||
}
|
||||
dd ("}");
|
||||
};
|
||||
|
||||
function processSourceChunk (start, callback, container)
|
||||
{
|
||||
dd ("processSourceChunk " + start + " {");
|
||||
/* build a chunk of the source text */
|
||||
const CHUNK_SIZE = 250;
|
||||
const CHUNK_DELAY = 100;
|
||||
|
||||
if (!container)
|
||||
{
|
||||
container = document.createElement ("source-lines");
|
||||
sourceContainer.appendChild (container);
|
||||
}
|
||||
|
||||
var stop = Math.min (sourceText.lines.length, start + CHUNK_SIZE);
|
||||
var rv = { previousState: null, previousNode: null };
|
||||
for (var i = start; i < stop; ++i)
|
||||
{
|
||||
rv = mungeLine (sourceText.lines[i], container, rv.previousState,
|
||||
rv.previousNode);
|
||||
}
|
||||
|
||||
if (i != sourceText.lines.length)
|
||||
{
|
||||
setTimeout (processSourceChunk, CHUNK_DELAY, i, callback,
|
||||
container);
|
||||
}
|
||||
else
|
||||
{
|
||||
callback();
|
||||
}
|
||||
dd ("}");
|
||||
};
|
||||
|
||||
function processSourceText ()
|
||||
{
|
||||
processSourceChunk (0, onComplete);
|
||||
};
|
||||
|
||||
function onComplete()
|
||||
{
|
||||
container.appendChild (sourceContainer);
|
||||
dd ("}");
|
||||
};
|
||||
|
||||
dd ("createDOMForSourceText " + sourceText.lines.length + " lines {");
|
||||
processMarginChunk (0, processSourceText);
|
||||
}
|
||||
|
||||
function st_contentGetter ()
|
||||
{
|
||||
if (!("_contentNode" in this))
|
||||
{
|
||||
this._contentNode = htmlSpan();
|
||||
createDOMForSourceText (this, this._contentNode);
|
||||
}
|
||||
|
||||
return this._contentNode;
|
||||
}
|
||||
|
||||
function SourceText (scriptInstance)
|
||||
{
|
||||
this.lines = new Array();
|
||||
|
@ -1202,8 +862,6 @@ function SourceText (scriptInstance)
|
|||
this.shortName = getFileFromPath (this.url);
|
||||
}
|
||||
|
||||
SourceText.prototype.__defineGetter__ ("contentNode", st_contentGetter);
|
||||
|
||||
SourceText.prototype.onMarginClick =
|
||||
function st_marginclick (e, line)
|
||||
{
|
||||
|
@ -1387,10 +1045,8 @@ function PPSourceText (scriptWrapper)
|
|||
|
||||
PPSourceText.prototype.isLoaded = true;
|
||||
|
||||
PPSourceText.prototype.__defineGetter__ ("contentNode", st_contentGetter);
|
||||
|
||||
PPSourceText.prototype.reloadSource =
|
||||
function pp_reload (cb)
|
||||
function ppst_reload (cb)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
@ -1431,7 +1087,7 @@ function pp_reload (cb)
|
|||
}
|
||||
|
||||
PPSourceText.prototype.onMarginClick =
|
||||
function st_marginclick (e, line)
|
||||
function ppst_marginclick (e, line)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
@ -1458,10 +1114,8 @@ function HelpText ()
|
|||
|
||||
HelpText.prototype.isLoaded = true;
|
||||
|
||||
HelpText.prototype.__defineGetter__ ("contentNode", st_contentGetter);
|
||||
|
||||
HelpText.prototype.reloadSource =
|
||||
function (cb)
|
||||
function ht_reload (cb)
|
||||
{
|
||||
var ary = console.commandManager.list();
|
||||
var str = "";
|
||||
|
|
|
@ -243,7 +243,7 @@ function htmlVA (attribs, href, contents)
|
|||
else
|
||||
attribs["class"] = "venkman-link";
|
||||
|
||||
if (!contents)
|
||||
if (typeof contents == "undefined")
|
||||
{
|
||||
contents = htmlSpan();
|
||||
insertHyphenatedWord (href, contents);
|
||||
|
@ -273,7 +273,8 @@ function insertLink (matchText, containerTag)
|
|||
else
|
||||
href = matchText;
|
||||
|
||||
var anchor = htmlVA (null, href, matchText);
|
||||
var anchor = htmlVA (null, href, "");
|
||||
insertHyphenatedWord(matchText, anchor);
|
||||
containerTag.appendChild (anchor);
|
||||
}
|
||||
|
||||
|
@ -457,7 +458,7 @@ function getBaseWindowFromWindow (win)
|
|||
|
||||
function getPathFromURL (url)
|
||||
{
|
||||
var ary = url.match(/^(.*\/)([^\/?]+)(\?|$)/);
|
||||
var ary = url.match(/^(.*\/)([^\/?#]+)(\?|#|$)/);
|
||||
if (ary)
|
||||
return ary[1];
|
||||
|
||||
|
@ -466,7 +467,7 @@ function getPathFromURL (url)
|
|||
|
||||
function getFileFromPath (path)
|
||||
{
|
||||
var ary = path.match(/\/([^\/?]+)(\?|$)/);
|
||||
var ary = path.match(/\/([^\/?#]+)(\?|#|$)/);
|
||||
if (ary)
|
||||
return ary[1];
|
||||
|
||||
|
|
|
@ -41,7 +41,7 @@ const DEFAULT_VURLS =
|
|||
"x-vloc:/mainwindow/vleft?target=view&id=locals; " +
|
||||
"x-vloc:/mainwindow/vleft?target=view&id=stack; ")) +
|
||||
("x-vloc:/mainwindow/outer?target=container&type=vertical&id=vright; " +
|
||||
("x-vloc:/mainwindow/vright?target=view&id=source; " +
|
||||
("x-vloc:/mainwindow/vright?target=view&id=source2; " +
|
||||
"x-vloc:/mainwindow/vright?target=view&id=session"))
|
||||
)
|
||||
);
|
||||
|
@ -327,7 +327,9 @@ function bv_init ()
|
|||
["clear-fbreak", { enabledif: "has('hasFBreak')" }],
|
||||
["-"],
|
||||
["clear-all"],
|
||||
["fclear-all"]
|
||||
["fclear-all"],
|
||||
["-"],
|
||||
["break-props"]
|
||||
]
|
||||
};
|
||||
|
||||
|
@ -726,9 +728,12 @@ function scv_init ()
|
|||
getContext: this.getContext,
|
||||
items:
|
||||
[
|
||||
["find-scriptinstance"],
|
||||
["find-script"],
|
||||
["clear-script", {enabledif: "cx.scriptWrapper.breakpointCount"}],
|
||||
["find-scriptinstance", {visibleif: "!has('scriptWrapper')"}],
|
||||
["find-script", {visibleif: "has('scriptWrapper')"}],
|
||||
["clear-instance", {visibleif: "!has('scriptWrapper')"}],
|
||||
["clear-script", {visibleif: "has('scriptWrapper')",
|
||||
enabledif: "cx.scriptWrapper.breakpointCount"}],
|
||||
["scan-source"],
|
||||
["-"],
|
||||
[">scripts:instance-flags"],
|
||||
[">scripts:wrapper-flags", {enabledif: "has('scriptWrapper')"}],
|
||||
|
@ -1757,6 +1762,7 @@ function ss_init ()
|
|||
this.cmdary =
|
||||
[
|
||||
["close-source-tab", cmdCloseTab, CMD_CONSOLE],
|
||||
["find-string", cmdFindString, CMD_CONSOLE],
|
||||
["save-source-tab", cmdSaveTab, CMD_CONSOLE],
|
||||
["reload-source-tab", cmdReloadTab, CMD_CONSOLE],
|
||||
["source-coloring", cmdToggleColoring, 0],
|
||||
|
@ -1770,6 +1776,7 @@ function ss_init ()
|
|||
["close-source-tab"],
|
||||
["reload-source-tab"],
|
||||
["save-source-tab", { enabledif: "console.views.source2.canSave()" }],
|
||||
["find-string"],
|
||||
["-"],
|
||||
["break",
|
||||
{enabledif: "cx.lineIsExecutable && !has('hasBreak')"}],
|
||||
|
@ -1780,6 +1787,7 @@ function ss_init ()
|
|||
["fclear",
|
||||
{enabledif: "has('hasFBreak')"}],
|
||||
["-"],
|
||||
["run-to"],
|
||||
["cont"],
|
||||
["next"],
|
||||
["step"],
|
||||
|
@ -1791,7 +1799,9 @@ function ss_init ()
|
|||
"== 'true'"} ],
|
||||
["toggle-pprint",
|
||||
{type: "checkbox",
|
||||
checkedif: "console.prefs['prettyprint']"}]
|
||||
checkedif: "console.prefs['prettyprint']"}],
|
||||
["-"],
|
||||
["break-props"]
|
||||
]
|
||||
};
|
||||
|
||||
|
@ -1820,6 +1830,20 @@ function cmdCloseTab (e)
|
|||
source2View.removeSourceTabAtIndex (e.index);
|
||||
}
|
||||
|
||||
function cmdFindString (e)
|
||||
{
|
||||
var source2View = console.views.source2;
|
||||
if (!source2View.tabs)
|
||||
return;
|
||||
|
||||
var index = source2View.tabs.selectedIndex;
|
||||
if (!(index in source2View.sourceTabList))
|
||||
return;
|
||||
|
||||
var browser = source2View.sourceTabList[index].iframe;
|
||||
findInPage (browser, browser.contentWindow, browser.contentWindow);
|
||||
}
|
||||
|
||||
function cmdReloadTab (e)
|
||||
{
|
||||
var source2View = console.views.source2;
|
||||
|
@ -1971,19 +1995,51 @@ function s2v_getcontext (cx)
|
|||
var row = cx.lineNumber - 1;
|
||||
|
||||
if (sourceText.lineMap[row] & LINE_BREAKABLE)
|
||||
{
|
||||
cx.lineIsExecutable = true;
|
||||
if ("scriptInstance" in sourceText)
|
||||
{
|
||||
var scriptInstance = sourceText.scriptInstance;
|
||||
var scriptWrapper =
|
||||
scriptInstance.getScriptWrapperAtLine(cx.lineNumber);
|
||||
if (scriptWrapper)
|
||||
{
|
||||
cx.scriptWrapper = scriptWrapper;
|
||||
cx.pc =
|
||||
scriptWrapper.jsdScript.lineToPc(cx.lineNumber,
|
||||
PCMAP_SOURCETEXT);
|
||||
}
|
||||
}
|
||||
else if ("scriptWrapper" in sourceText)
|
||||
{
|
||||
cx.scriptWrapper = sourceText.scriptWrapper;
|
||||
cx.pc =
|
||||
cx.scriptWrapper.jsdScript.lineToPc(cx.lineNumber,
|
||||
PCMAP_PRETTYPRINT);
|
||||
}
|
||||
}
|
||||
|
||||
if (sourceText.lineMap[row] & LINE_BREAK)
|
||||
{
|
||||
cx.hasBreak = true;
|
||||
cx.breakWrapper =
|
||||
sourceText.scriptInstance.getBreakpoint(cx.lineNumber);
|
||||
if (cx.breakWrapper.parentBP)
|
||||
if ("scriptInstance" in sourceText)
|
||||
{
|
||||
cx.breakWrapper =
|
||||
sourceText.scriptInstance.getBreakpoint(cx.lineNumber);
|
||||
}
|
||||
else if ("scriptWrapper" in sourceText && "pc" in cx)
|
||||
{
|
||||
cx.breakWrapper =
|
||||
sourceText.scriptWrapper.getBreakpoint(cx.pc);
|
||||
}
|
||||
|
||||
if ("breakWrapper" in cx && cx.breakWrapper.parentBP)
|
||||
cx.hasFBreak = true;
|
||||
}
|
||||
else if (sourceText.lineMap[row] & LINE_FBREAK)
|
||||
{
|
||||
cx.hasFBreak = true;
|
||||
cx.breakWrapper = getFutureBreakpoint(cx.lineNumber);
|
||||
cx.breakWrapper = getFutureBreakpoint(cx.url, cx.lineNumber);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -2043,7 +2099,7 @@ function s2v_updatemargin (sourceTab, line)
|
|||
if (!("lineMap" in sourceTab.sourceText))
|
||||
return;
|
||||
|
||||
if (!ASSERT(sourceTab.content, "no content for source tab"))
|
||||
if (!sourceTab.content)
|
||||
return;
|
||||
|
||||
var node = sourceTab.content.childNodes[line * 2 - 1];
|
||||
|
@ -2868,6 +2924,7 @@ function sv_init()
|
|||
["fclear",
|
||||
{enabledif: "has('hasFBreak')"}],
|
||||
["-"],
|
||||
["run-to"],
|
||||
["cont"],
|
||||
["next"],
|
||||
["step"],
|
||||
|
@ -2875,7 +2932,9 @@ function sv_init()
|
|||
["-"],
|
||||
["toggle-pprint",
|
||||
{type: "checkbox",
|
||||
checkedif: "console.prefs['prettyprint']"}]
|
||||
checkedif: "console.prefs['prettyprint']"}],
|
||||
["-"],
|
||||
["break-props"]
|
||||
]
|
||||
};
|
||||
|
||||
|
@ -3230,7 +3289,31 @@ function sv_getcx(cx)
|
|||
cx.lineNumber = row + 1;
|
||||
|
||||
if (sourceText.lineMap[row] & LINE_BREAKABLE)
|
||||
{
|
||||
cx.lineIsExecutable = true;
|
||||
|
||||
if ("scriptInstance" in sourceText)
|
||||
{
|
||||
var scriptInstance = sourceText.scriptInstance;
|
||||
var scriptWrapper =
|
||||
scriptInstance.getScriptWrapperAtLine(cx.lineNumber);
|
||||
if (scriptWrapper)
|
||||
{
|
||||
cx.scriptWrapper = scriptWrapper;
|
||||
cx.pc =
|
||||
scriptWrapper.jsdScript.lineToPc(cx.lineNumber,
|
||||
PCMAP_SOURCETEXT);
|
||||
}
|
||||
}
|
||||
else if ("scriptWrapper" in sourceText)
|
||||
{
|
||||
cx.scriptWrapper = sourceText.scriptWrapper;
|
||||
cx.pc =
|
||||
cx.scriptWrapper.jsdScript.lineToPc(cx.lineNumber,
|
||||
PCMAP_PRETTYPRINT);
|
||||
}
|
||||
}
|
||||
|
||||
if (sourceText.lineMap[row] & LINE_BREAK)
|
||||
{
|
||||
cx.hasBreak = true;
|
||||
|
@ -3242,7 +3325,7 @@ function sv_getcx(cx)
|
|||
else if (sourceText.lineMap[row] & LINE_FBREAK)
|
||||
{
|
||||
cx.hasFBreak = true;
|
||||
cx.breakWrapper = getFutureBreakpoint(row + 1);
|
||||
cx.breakWrapper = getFutureBreakpoint(cx.url, row + 1);
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -3258,7 +3341,7 @@ function sv_getcx(cx)
|
|||
else if (sourceText.lineMap[row] & LINE_FBREAK)
|
||||
{
|
||||
cx.hasFBreak = true;
|
||||
cx.breakWrapperList.push(getFutureBreakpoint(row + 1));
|
||||
cx.breakWrapperList.push(getFutureBreakpoint(cx.url, row + 1));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -65,7 +65,7 @@
|
|||
<overlaytarget id="views-overlay-target"/>
|
||||
|
||||
<viewcontainer id="root-container" flex="1" type="horizontal">
|
||||
<viewcontainer id="initial-container" type="vertical" flex="1"/>
|
||||
<viewcontainer id="initial-container" type="horizontal" flex="1"/>
|
||||
</viewcontainer>
|
||||
|
||||
<overlaytarget id="statusbar-overlay-target"/>
|
||||
|
|
|
@ -39,13 +39,17 @@ const VMGR_SCHEME_LEN = VMGR_VURL_SCHEME.length;
|
|||
const VMGR_HIDDEN = "hidden";
|
||||
const VMGR_NEW = "new";
|
||||
const VMGR_MAINWINDOW = "mainwindow";
|
||||
const VMGR_GUTTER = "gutter";
|
||||
|
||||
const VMGR_VURL_HIDDEN = VMGR_VURL_SCHEME + "/" + VMGR_HIDDEN;
|
||||
const VMGR_VURL_NEW = VMGR_VURL_SCHEME + "/" + VMGR_NEW;
|
||||
const VMGR_VURL_MAINWINDOW = VMGR_VURL_SCHEME + "/" + VMGR_MAINWINDOW;
|
||||
|
||||
const VMGR_VURL_GUTTER = VMGR_VURL_MAINWINDOW + "/gutter";
|
||||
const VMGR_DEFAULT_CONTAINER = "initial-container";
|
||||
|
||||
var VMGR_GUTTER_CONTAINER = VMGR_VURL_MAINWINDOW + "?target=container&" +
|
||||
"id=" + VMGR_GUTTER + "&type=vertical";
|
||||
|
||||
function ViewManager(commandManager, mainWindow)
|
||||
{
|
||||
this.commandManager = commandManager;
|
||||
|
@ -519,10 +523,18 @@ function vmgr_getlocation (parsedLocation)
|
|||
ViewManager.prototype.ensureLocation =
|
||||
function vmgr_ensurelocation (parsedLocation, cb)
|
||||
{
|
||||
var viewManager = this;
|
||||
|
||||
function onWindowLoaded (window)
|
||||
{
|
||||
var container =
|
||||
window.document.getElementById (parsedLocation.containerId);
|
||||
if (!container && parsedLocation.containerId == VMGR_GUTTER)
|
||||
{
|
||||
viewManager.reconstituteVURLs ([VMGR_GUTTER_CONTAINER]);
|
||||
container =
|
||||
window.document.getElementById (parsedLocation.containerId);
|
||||
}
|
||||
cb (window, container);
|
||||
};
|
||||
|
||||
|
@ -681,7 +693,7 @@ function vmgr_move (parsedLocation, viewId, height, width)
|
|||
var view = this.views[viewId];
|
||||
var currentContent = ("currentContent" in view ?
|
||||
view.currentContent : null);
|
||||
if (currentContent)
|
||||
if (currentContent && currentContent.ownerWindow == this.mainWindow)
|
||||
view.previousLocation = this.computeLocation(currentContent);
|
||||
|
||||
this.ensureLocation (parsedLocation, onLocationFound);
|
||||
|
|
|
@ -25,6 +25,8 @@ venkman.jar:
|
|||
content/venkman/venkman-munger.js (content/venkman-munger.js)
|
||||
content/venkman/venkman-views.js (content/venkman-views.js)
|
||||
content/venkman/venkman-records.js (content/venkman-records.js)
|
||||
content/venkman/venkman-bpprops.xul (content/venkman-bpprops.xul)
|
||||
content/venkman/venkman-bpprops.js (content/venkman-bpprops.js)
|
||||
content/venkman/tree-utils.js (content/tree-utils.js)
|
||||
content/venkman/file-utils.js (content/file-utils.js)
|
||||
content/venkman/html-consts.js (content/html-consts.js)
|
||||
|
|
|
@ -36,6 +36,11 @@
|
|||
|
||||
<!ENTITY MainWindow.title "JavaScript Debugger">
|
||||
|
||||
<!-- floating views -->
|
||||
<!ENTITY ViewFloat.tooltip "Click here to float/unfloat this view">
|
||||
<!ENTITY ViewGrippy.tooltip "Drag titlebar to move this view">
|
||||
<!ENTITY ViewClose.tooltip "Click here to close this view">
|
||||
|
||||
<!-- help menu -->
|
||||
<!ENTITY Help.commands "Command Reference">
|
||||
<!ENTITY Help.about "About Venkman">
|
||||
|
@ -91,3 +96,23 @@
|
|||
<!-- window view -->
|
||||
<!ENTITY Windows.label "Open Windows">
|
||||
<!ENTITY WindowsCol0.label "File">
|
||||
|
||||
<!-- breakpoint properties window -->
|
||||
<!ENTITY BPProps.URL.label "URL">
|
||||
<!ENTITY BPProps.Line.label "Line">
|
||||
<!ENTITY BPProps.PC.label "PC">
|
||||
<!ENTITY BPProps.FunctionName.label "Function">
|
||||
<!ENTITY BPProps.TriggerCount.label "Trigger count">
|
||||
<!ENTITY BPProps.OneTime.label "Clear breakpoint after first trigger">
|
||||
<!ENTITY BPProps.Then.label "Then ...">
|
||||
<!ENTITY BPProps.ConditionalCheck.label "When triggered, execute...">
|
||||
<!ENTITY BPProps.NeverStopRadio.label "Continue regardless of result">
|
||||
<!ENTITY BPProps.AlwaysStopRadio.label "Stop regardless of result">
|
||||
<!ENTITY BPProps.ConditionalBreakRadio.label "Stop if result is true">
|
||||
<!ENTITY BPProps.EarlyReturnRadio.label "Early return from caller with result">
|
||||
<!ENTITY BPProps.PassExceptionsCheck.label "Pass exceptions to caller">
|
||||
<!ENTITY BPProps.LogResultCheck.label "Log result">
|
||||
<!ENTITY BPProps.Apply.label "Apply">
|
||||
<!ENTITY BPProps.Revert.label "Revert">
|
||||
<!ENTITY BPProps.Close.label "Close">
|
||||
|
||||
|
|
|
@ -91,8 +91,9 @@ msn.err.no.template = No pref for template named ``%1$S''.
|
|||
msn.err.internal.dispatch = Internal error dispatching command ``%1$S''.
|
||||
msn.err.source.load.failed = Error loading URL <%1$S>: %2$S.
|
||||
msn.err.no.such.container = No such container ``%1$S''.
|
||||
msg.err.condition.failed = Error evaluating breakpoint condition.
|
||||
msg.err.format.not.available = Source not available in requested format.
|
||||
|
||||
msn.err.no.function = Line %1$S in <%1$S> is not part of an executable function.
|
||||
msn.jsdurl.errpage = <html><head><title>Error</title></head><body>Error loading <<b>%1$S</b>><br>%2$S</body></html>
|
||||
msg.err.jsdurl.parse = Error parsing URL.
|
||||
msg.err.jsdurl.nosource = URL has no textual source.
|
||||
|
@ -100,7 +101,7 @@ msg.err.jsdurl.noservice = No such service.
|
|||
msg.err.jsdurl.search = Error in search pattern.
|
||||
msg.err.jsdurl.sourcetext = Error locating source text.
|
||||
msn.err.jsdurl.template = Error loading template named ``%1$S''.
|
||||
|
||||
msn.err.meta.failed = Error processing meta comment ``%1$S'' in <%2$S>, line %3$S.
|
||||
|
||||
## "values" ##
|
||||
msg.val.unknown = <unknown>
|
||||
|
@ -161,7 +162,7 @@ msn.cont = Continuing from %1$S.
|
|||
msn.subscript.loaded = Subscript <%1$S> loaded with result ``%2$S''.
|
||||
# 1 exception name, 2 fileName, 3 lineNumber
|
||||
msn.eval.error = %1$S: <%2$S>, line %3$S
|
||||
msn.eval.threw = Caught exception: %1$S
|
||||
msn.eval.threw = Caught exception: ``%1$S''
|
||||
msg.hello = Welcome to ``Venkman'', the JavaScript debugger. Please read the FAQ at <http://www.hacksrus.com/~ginda/venkman/faq/venkman-faq.html>. Visit the Venkman homepage <http://www.mozilla.org/projects/venkman/> for more information.
|
||||
msn.version = You are running Venkman version %1$S.
|
||||
msg.tip1.help = Use ``help <command-name>'' for help on specific commands.
|
||||
|
@ -187,7 +188,7 @@ msn.fbp.line = #%1$S <%2$S> line %3$S
|
|||
msn.fbp.created = Future breakpoint at <%1$S> line %2$S created.
|
||||
msn.fbp.cleared = Future breakpoint at <%1$S> line %2$S cleared.
|
||||
msn.fbp.exists = Future breakpoint at <%1$S> line %2$S already set.
|
||||
msn.source.line = %1$S: %2$S
|
||||
msn.source.line = %1$S: %2$S"
|
||||
msg.emode.ignore = Errors will now be ignored.
|
||||
msg.emode.trace = Errors will now be traced.
|
||||
msg.emode.break = Errors will now stop the debug target.
|
||||
|
@ -318,6 +319,11 @@ msg.margin.fbreak = " F "
|
|||
msg.margin.breakable = " - "
|
||||
msg.margin.none = " "
|
||||
|
||||
msg.bpprops.title = Breakpoint Properties
|
||||
msg.bpprops.enabled = Enable breakpoint
|
||||
msg.fbpprops.title = Future Breakpoint Properties
|
||||
msg.fbpprops.enabled = Enable future breakpoint
|
||||
|
||||
###################### DO NO LOCALIZE THE *.params STRINGS ######################
|
||||
|
||||
## hooks ##
|
||||
|
@ -404,6 +410,10 @@ cmd.break.label = S&et Breakpoint
|
|||
cmd.break.params = [<url-pattern> <line-number>]
|
||||
cmd.break.help = Set a breakpoint in all urls matching <url-pattern> at the line number <line-number>. If no parameters are specified all active breakpoints will be listed. See also: clear.
|
||||
|
||||
cmd.break-props.label = Breakpoint &Properties...
|
||||
cmd.break-props.params = <break-wrapper> [<...>]
|
||||
cmd.break-props.help = Display the properties dialog for the breakpoint represented by <break-wrapper>.
|
||||
|
||||
cmd.chrome-filter.params = [<toggle>]
|
||||
cmd.chrome-filter.help = Enables or disabled the filtering of chrome: urls. With chrome: filtering on, the JavaScript files which make up the browser will not be displayed in the Script View, and the debugger will not step through them while debugging. 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.
|
||||
|
||||
|
@ -414,23 +424,26 @@ cmd.clear.help = Clears breakpoints in files which match <url-pattern>. If <l
|
|||
cmd.clear-all.label = Clear &All Breakpoints
|
||||
cmd.clear-all.help = Clears every breakpoint currently defined.
|
||||
|
||||
cmd.clear-break.label = &Clear Breakpoint(s)
|
||||
cmd.clear-break.label = &Clear Breakpoint
|
||||
cmd.clear-break.params = <break-wrapper> [<...>]
|
||||
cmd.clear-break.help = Clear the breakpoint wrapped by <break-wrapper>. If <break-wrapper> is a future breakpoint object, all child breakpoints will be cleared, but the future breakpoint will remain.
|
||||
|
||||
cmd.clear-fbreak.label = Clear &Future Breakpoint(s)
|
||||
cmd.clear-fbreak.label = Clear &Future Breakpoint
|
||||
cmd.clear-fbreak.params = <break-wrapper> [<...>]
|
||||
cmd.clear-fbreak.help = Clear the future breakpoint wrapped by <break-wrapper>. If <break-wrapper> is a breakpoint instance object, the instance's parent future breakpoint will be cleared, but the instance will remain. If the instance has no parent future breakpoint, the wrapper will be ignored.
|
||||
|
||||
cmd.clear-profile.label = C&lear Profile Data
|
||||
cmd.clear-profile.help = Zeros out any existing profile data.
|
||||
|
||||
cmd.clear-script.label = &Clear Script Breakpoint(s)
|
||||
cmd.clear-script.label = &Clear Breakpoint(s)
|
||||
cmd.clear-script.params = <script-wrapper> [<...>]
|
||||
cmd.clear-script.help = Clear all breakpoints in the script wrapped by <script-wrapper>.
|
||||
|
||||
cmd.clear-instance.label = &Clear Breakpoint(s)
|
||||
cmd.clear-instance.params = <script-instance> [<...>]
|
||||
cmd.clear-instance.help = Clear all breakpoints in the script instance referred to by <script-instance>.
|
||||
|
||||
cmd.close.label = &Close
|
||||
cmd.close.key = accel W
|
||||
cmd.close.help = Close the debugger.
|
||||
|
||||
cmd.commands.params = [<pattern>]
|
||||
|
@ -526,7 +539,11 @@ cmd.find-sourcetext.help = Displays the source text object <sourceText>. All
|
|||
cmd.find-sourcetext-soft.params = <source-text> [<range-start> [<range-end> [<details> [<target-line>]]]]
|
||||
cmd.find-sourcetext-soft.help = Functions the same as |find-sourcetext|, except the view is not scrolled if <target-line> is already visible.
|
||||
|
||||
cmd.find-scriptinstance.label = &Find Script Instance
|
||||
cmd.find-string.label = Fin&d in This File...
|
||||
cmd.find-string.key = accel F
|
||||
cmd.find-string.help = Brings up a ``Find Dialog'' for the currently selected tab.
|
||||
|
||||
cmd.find-scriptinstance.label = &Find File
|
||||
cmd.find-scriptinstance.params = <script-instance> [<range-start> [<range-end> [<details> [<target-line>]]]]
|
||||
cmd.find-scriptinstance.help = Displays the source text associated with the script instance <script-instance>. All of the text between <range-start> and <range-end> will be highlighted. If <details> is provided, it will be an object representing details about where the <url> object was derived from. If <target-line> is provided, the view will be scrolled to that line, otherwise the view will be scrolled to <range-start>.
|
||||
|
||||
|
@ -620,6 +637,7 @@ cmd.release-notes.label = &Release Notes
|
|||
cmd.release-notes.help = Display the Mozilla release notes.
|
||||
|
||||
cmd.close-source-tab.label = &Close Tab
|
||||
cmd.close-source-tab.key = accel W
|
||||
cmd.close-source-tab.params = [<index>]
|
||||
cmd.close-source-tab.help = Close the tab located at the index specified by <index>. If <index> is not provided, the current tab will be closed.
|
||||
|
||||
|
@ -628,6 +646,10 @@ cmd.restore-layout.help = Restores the view layout named <name>. If <name> is
|
|||
|
||||
cmd.reloadui.key = accel alt R
|
||||
|
||||
cmd.run-to.label = Run To &Line
|
||||
cmd.run-to.params = <script-wrapper> <pc>
|
||||
cmd.run-to.help = Continue execution until program counter specified by <pc>, in the script specified by <script-wrapper> is reached. The has the effect of setting a ``one time'' breakpoint at the line in question.
|
||||
|
||||
cmd.save-default-layout.label = &Save Default Layout Now
|
||||
|
||||
cmd.save-layout.params = [<name>]
|
||||
|
@ -649,6 +671,10 @@ cmd.session-css-default.label = &Browser Defaults
|
|||
cmd.session-css-dark.label = &Dark Background/Light Text
|
||||
cmd.session-css-light.label = &Light Background/Dark Text
|
||||
|
||||
cmd.scan-source.label = &Scan For Meta Comments
|
||||
cmd.scan-source.params = <script-instance>
|
||||
cmd.scan-source.help = Scans the entire source file for comments in the form //@JSD_DIRECTIVE. By default, the directives recognized are //@JSD_LOG, //@JSD_BREAK, and //@JSD_EVAL. JSD_LOG evaluates whatever script follows it, logging the result to the Interactive Session view. JSD_BREAK inserts a conditional breakpoint a the next executable line. JSD_EVAL evaluates whatever script follows it, without logging or breaking. Users can add additional directives with plug ins.
|
||||
|
||||
cmd.scope.help = Lists the properties of the topmost object in the scope chain for the current frame.
|
||||
|
||||
cmd.startup-init.label = Initialize at &Startup
|
||||
|
|
Загрузка…
Ссылка в новой задаче