Skip to content

Commit 4ce0cdc

Browse files
author
Chris K
committed
Review fixes.
1 parent 7d4fe70 commit 4ce0cdc

File tree

12 files changed

+33
-22
lines changed

12 files changed

+33
-22
lines changed

src/build-application/build_application.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,10 @@ window.app.build_application = function(on_services_created, on_services_enabled
182182

183183
var report_usage = function()
184184
{
185-
if (settings.general.get("track-usage") && !location.port)
185+
if (settings.general.get("track-usage") &&
186+
// Don't phone home when developing
187+
// (port is typically only used in that situation).
188+
!location.port)
186189
{
187190
var trackerurl = "/app/user-count"
188191
var tracker = new cls.UserTracker(trackerurl);

src/build-application/build_ecmascript_debugger_6_0.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ window.app.builders.EcmascriptDebugger["6.0"] = function(service)
2020

2121
cls.InspectableJSObject = namespace.InspectableJSObject;
2222
cls.JSInspectionTooltip.register();
23-
cls.EvListenerTooltip.register();
23+
cls.EventListenerTooltip.register();
2424
// disabled for now. see CORE-32113
2525
// cls.InspectableJSObject.register_enabled_listener();
2626
// for now we are filtering on the client side

src/client-en.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -212,8 +212,8 @@ window.load_screen_timeout = window.setTimeout(function()
212212
<script src="./lib/canvasrenderingcontext2dprototype.js"/>
213213
<script src="./lib/dateprototype.js"/>
214214
<script src="./lib/nodelistprototype.js"/>
215-
<script src="./lib/object.js"/>
216-
<script src="./lib/opera.js"/>
215+
<script src="./lib/objectnamespace.js"/>
216+
<script src="./lib/operanamespace.js"/>
217217
<script src="./lib/stringprototype.js"/>
218218
<script src="./lib/stylesheetlistprototype.js"/>
219219
<script src="./lib/xmlhttprequestprototype.js"/>

src/ecma-debugger/dominspection/inspectabledomnode.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ cls.EcmascriptDebugger["6.0"].InspectableDOMNode.CONTENT_DOCUMENT = 11;
2828
cls.EcmascriptDebugger["6.0"].InspectableDOMNode.FRAME_ELEMENT = 12;
2929
cls.EcmascriptDebugger["6.0"].InspectableDOMNode.MATCH_REASON = 13;
3030
cls.EcmascriptDebugger["6.0"].InspectableDOMNode.PSEUDO_ELEMENT = 14;
31-
cls.EcmascriptDebugger["6.0"].InspectableDOMNode.PSEUDO_NODE = 0;
3231
cls.EcmascriptDebugger["6.0"].InspectableDOMNode.EVENT_LISTENER_LIST = 15;
32+
cls.EcmascriptDebugger["6.0"].InspectableDOMNode.PSEUDO_NODE = 0;
3333

3434
cls.EcmascriptDebugger["6.0"].InspectableDOMNode.prototype = new function()
3535
{

src/ecma-debugger/dominspection/templates.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -275,11 +275,13 @@
275275
case DOCUMENT_NODE:
276276
{
277277
if (ev_listener)
278+
{
278279
tree += "<div class='search-match dom-search document' " +
279280
"rt-id='" + String(model.getDataRuntimeId()) + "' " +
280281
"obj-id='" + String(node[ID]) + "' " +
281282
"handler='inspect-object-link' >" +
282283
"document" + ev_listener + "</div>";
284+
}
283285
break;
284286
}
285287
case DOCUMENT_TYPE_NODE:

src/ecma-debugger/eventlisteners/evlistenertemplates.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@
6868
{
6969
var tmpl_obj_l = window.templates.ev_window_listeners(ev_type);
7070
var tmpl_node_l = window.templates.dom_search(ev_type);
71-
return["div", tmpl_obj_l, [tmpl_node_l], "class", "ev-listener-list mono"];
71+
return ["div", tmpl_obj_l, [tmpl_node_l], "class", "ev-listener-list mono"];
7272
};
7373

7474
this.ev_window_listeners = function(ev_type)

src/ecma-debugger/eventlisteners/evlistenertooltip.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
window.cls || (window.cls = {});
44

5-
cls.EvListenerTooltip = function()
5+
cls.EventListenerTooltip = function()
66
{
77
var _tooltip = null;
88
var _url_tooltip = null;
@@ -50,7 +50,7 @@ cls.EvListenerTooltip = function()
5050

5151
var _init = function(view)
5252
{
53-
_tooltip = Tooltips.register(cls.EvListenerTooltip.tooltip_name, true);
53+
_tooltip = Tooltips.register(cls.EventListenerTooltip.tooltip_name, true);
5454
_url_tooltip = Tooltips.register("url-tooltip", true);
5555
_tooltip.ontooltip = _ontooltip;
5656
_tooltip.onhide = _hide_tooltip;
@@ -62,9 +62,9 @@ cls.EvListenerTooltip = function()
6262
_init();
6363
};
6464

65-
cls.EvListenerTooltip.tooltip_name = "event-listener";
65+
cls.EventListenerTooltip.tooltip_name = "event-listener";
6666

67-
cls.EvListenerTooltip.register = function()
67+
cls.EventListenerTooltip.register = function()
6868
{
69-
this._tooltip = new cls.EvListenerTooltip();
69+
this._tooltip = new cls.EventListenerTooltip();
7070
};

src/ecma-debugger/js-source-view.js

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -466,8 +466,10 @@ cls.JsSourceView = function(id, name, container_class)
466466

467467
line_no_end || (line_no_end = line_no_start);
468468
this.showLine(script_id, line_no_start);
469-
this._change_highlight_class_lines("addClass", line_no_start, line_no_end);
470-
var cb = this._change_highlight_class_lines.bind(this, "removeClass",
469+
this._change_highlight_class_lines(Element.prototype.addClass,
470+
line_no_start, line_no_end);
471+
var cb = this._change_highlight_class_lines.bind(this,
472+
Element.prototype.removeClass,
471473
line_no_start, line_no_end);
472474
setTimeout(cb, 1000);
473475
};
@@ -477,7 +479,7 @@ cls.JsSourceView = function(id, name, container_class)
477479
for (var i = start, line; i <= end; i++)
478480
{
479481
if (line = this.get_line_element(i))
480-
line[method]("selected-js-source-line");
482+
method.call(line, "selected-js-source-line");
481483
}
482484
};
483485

@@ -511,11 +513,10 @@ cls.JsSourceView = function(id, name, container_class)
511513
this.showLine = function(script_id, line_no, is_parse_error, is_scroll)
512514
{
513515
if (__timeout_clear_view)
514-
{
515516
__timeout_clear_view = clearTimeout(__timeout_clear_view);
516-
}
517517

518-
var is_visible = (source_content = document.querySelector(CONTAINER_SELECTOR)) ? true : false;
518+
source_content = document.querySelector(CONTAINER_SELECTOR);
519+
var is_visible = Boolean(source_content);
519520
// if the view is visible it shows the first new script
520521
// before any parse error, that means in case of a parse error
521522
// the current script has not set the parse_error property
@@ -804,7 +805,8 @@ cls.JsSourceView = function(id, name, container_class)
804805

805806
var __clearView = function()
806807
{
807-
if( ( source_content = document.querySelector(CONTAINER_SELECTOR) ) && source_content.parentElement )
808+
source_content = document.querySelector(CONTAINER_SELECTOR);
809+
if (source_content && source_content.parentElement)
808810
{
809811
var
810812
divs = source_content.parentElement.parentElement.getElementsByTagName('div'),
@@ -1031,6 +1033,7 @@ cls.JsSourceView.update_breakpoints = function(script, line_numbers, top_line)
10311033
var span = line_numbers.querySelector(".line-number");
10321034
top_line = span && Number(span.textContent);
10331035
}
1036+
10341037
if (lines && bp_states && typeof top_line == "number")
10351038
{
10361039
for (var i = 0, line; line = lines[i]; i++)

src/ecma-debugger/newscript.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,7 @@ window.cls.NewScriptPrototype = function()
238238
}
239239
}
240240
}
241+
241242
if (end_line == -1)
242243
{
243244
index = 0;

src/ecma-debugger/objectinspection.6.0/prettyprinter.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,7 @@ cls.PrettyPrinter.types[cls.PrettyPrinter.FUNCTION] =
133133
"data-script-endline", String(end_line)),
134134
head = ["h2", sc_link, "class", "js-tooltip-title"];
135135
}
136+
136137
for (var i = start_line; i <= end_line; i++)
137138
{
138139
var data = script.get_line(i);
@@ -236,12 +237,13 @@ cls.PrettyPrinter.prototype = new function()
236237

237238
list.forEach(function(type)
238239
{
240+
var type_obj = cls.PrettyPrinter.types[type];
239241
if (cls.PrettyPrinter.types.hasOwnProperty(type) &&
240-
!this._types.contains(cls.PrettyPrinter.types[type]))
242+
!this._types.contains(type_obj))
241243
{
242-
this._types.push(cls.PrettyPrinter.types[type]);
243-
if (cls.PrettyPrinter.types[type].init)
244-
cls.PrettyPrinter.types[type].init();
244+
this._types.push(type_obj);
245+
if (type_obj.init)
246+
type_obj.init();
245247
}
246248
}, this);
247249
};

0 commit comments

Comments
 (0)