lookingGlass: Fix misleading typeof use

typeof is an operator, not a function. Putting unneeded parentheses
around the expression obfuscates that.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/710
This commit is contained in:
Florian Müllner 2019-08-19 20:11:12 +02:00 committed by Florian Müllner
parent b6a2b2b8a5
commit 691610f23c

View File

@ -240,7 +240,7 @@ var Notebook = class Notebook {
Signals.addSignalMethods(Notebook.prototype); Signals.addSignalMethods(Notebook.prototype);
function objectToString(o) { function objectToString(o) {
if (typeof(o) == typeof(objectToString)) { if (typeof o == typeof objectToString) {
// special case this since the default is way, way too verbose // special case this since the default is way, way too verbose
return '<js function>'; return '<js function>';
} else { } else {
@ -369,7 +369,7 @@ var ObjInspector = class ObjInspector {
let hbox = new St.BoxLayout({ style_class: 'lg-obj-inspector-title' }); let hbox = new St.BoxLayout({ style_class: 'lg-obj-inspector-title' });
this._container.add_actor(hbox); this._container.add_actor(hbox);
let label = new St.Label({ text: 'Inspecting: %s: %s'.format(typeof(obj), let label = new St.Label({ text: 'Inspecting: %s: %s'.format(typeof obj,
objectToString(obj)) }); objectToString(obj)) });
label.single_line_mode = true; label.single_line_mode = true;
hbox.add(label, { expand: true, y_fill: false }); hbox.add(label, { expand: true, y_fill: false });
@ -387,7 +387,7 @@ var ObjInspector = class ObjInspector {
button.add_actor(new St.Icon({ icon_name: 'window-close-symbolic' })); button.add_actor(new St.Icon({ icon_name: 'window-close-symbolic' }));
button.connect('clicked', this.close.bind(this)); button.connect('clicked', this.close.bind(this));
hbox.add(button); hbox.add(button);
if (typeof(obj) == typeof({})) { if (typeof obj == typeof {}) {
let properties = []; let properties = [];
for (let propName in obj) { for (let propName in obj) {
properties.push(propName); properties.push(propName);