Skip to content

Commit

Permalink
Fix ECMAScript 6 type warning
Browse files Browse the repository at this point in the history
This commit fixes warnign messages like:
"Some code accessed the property 'Processes' on the module 'util'. That property was defined with 'let' or 'const' inside the module. This was previously supported, but is not correct according to the ES6 standard. Any symbols to be exported from a module must be defined with 'var'. The property access will work as previously for the time being, but please fix your code anyway."
  • Loading branch information
elvetemedve committed Jan 28, 2018
1 parent aeea331 commit 20b7111
Show file tree
Hide file tree
Showing 8 changed files with 35 additions and 34 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
/build
/build
/.idea/
2 changes: 1 addition & 1 deletion [email protected]/factory.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const Lang = imports.lang;
const Gio = imports.gi.Gio;
const PrefsKeys = Me.imports.prefs_keys;

const AbstractFactory = (function() {
var AbstractFactory = (function() {

var types = {};

Expand Down
2 changes: 1 addition & 1 deletion [email protected]/indicator.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ let color_range = [];
// CSS class name.
let caution_class = '';

const Icon = new Lang.Class({
var Icon = new Lang.Class({
Name: 'Icon',
Extends: St.Icon
});
Expand Down
12 changes: 6 additions & 6 deletions [email protected]/meter.js
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ MeterSubject.prototype.hasActivity = function() {

MeterSubject.prototype.destroy = function() {};

const CpuMeter = function() {
var CpuMeter = function() {
this.observers = [];
this._statistics = {
cpu: { user:0, nice:0, guest:0, guest_nice:0, system:0, irq: 0, softirq: 0, idle: 0, iowait: 0, steal: 0 },
Expand Down Expand Up @@ -227,7 +227,7 @@ const CpuMeter = function() {
CpuMeter.prototype = new MeterSubject();


const MemoryMeter = function(calculation_method) {
var MemoryMeter = function(calculation_method) {
this.observers = [];
if (-1 == ['ram_only', 'all'].indexOf(calculation_method)) {
throw new RangeError('Unknown memory calculation method given: ' + calculation_method);
Expand Down Expand Up @@ -299,7 +299,7 @@ const MemoryMeter = function(calculation_method) {
MemoryMeter.prototype = new MeterSubject();


const StorageMeter = function() {
var StorageMeter = function() {
this.observers = [];
let mount_entry_pattern = new RegExp('^\\S+\\s+(\\S+)\\s+(\\S+)');
let fs_types_to_measure = [
Expand Down Expand Up @@ -356,7 +356,7 @@ const StorageMeter = function() {
StorageMeter.prototype = new MeterSubject();


const NetworkMeter = function(refresh_interval) {
var NetworkMeter = function(refresh_interval) {
this.observers = [];
this._statistics = {};
this._bandwidths = {};
Expand Down Expand Up @@ -487,7 +487,7 @@ const NetworkMeter = function(refresh_interval) {
NetworkMeter.prototype = new MeterSubject();


const SwapMeter = function() {
var SwapMeter = function() {
this.observers = [];
let swap_utility = new Util.Swap;
let processes = new Util.Processes;
Expand Down Expand Up @@ -541,7 +541,7 @@ const SwapMeter = function() {
SwapMeter.prototype = new MeterSubject();


const SystemLoadMeter = function() {
var SystemLoadMeter = function() {
this.observers = [];
this._number_of_cpu_cores = null;
let load = new GTop.glibtop_loadavg();
Expand Down
18 changes: 9 additions & 9 deletions [email protected]/prefs_keys.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
const REFRESH_INTERVAL = 'refresh-interval';
const CPU_METER = 'cpu-meter';
const MEMORY_METER = 'memory-meter';
const STORAGE_METER = 'storage-meter';
const NETWORK_METER = 'network-meter';
const SWAP_METER = 'swap-meter';
const LOAD_METER = 'load-meter';
const POSITION = 'position';
const MEMORY_CALCULATION_METHOD = 'memory-calculation-method';
var REFRESH_INTERVAL = 'refresh-interval';
var CPU_METER = 'cpu-meter';
var MEMORY_METER = 'memory-meter';
var STORAGE_METER = 'storage-meter';
var NETWORK_METER = 'network-meter';
var SWAP_METER = 'swap-meter';
var LOAD_METER = 'load-meter';
var POSITION = 'position';
var MEMORY_CALCULATION_METHOD = 'memory-calculation-method';
10 changes: 5 additions & 5 deletions [email protected]/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const Me = imports.misc.extensionUtils.getCurrentExtension();
const FactoryModule = Me.imports.factory;
const Promise = Me.imports.helpers.promise.Promise;

let Process = new Lang.Class({
var Process = new Lang.Class({
Name: "Process",

_init: function(id) {
Expand All @@ -19,7 +19,7 @@ let Process = new Lang.Class({
}
});

let Processes = new Lang.Class({
var Processes = new Lang.Class({
Name: "Processes",

/**
Expand Down Expand Up @@ -76,7 +76,7 @@ let Processes = new Lang.Class({
}
});

let Directories = new Lang.Class({
var Directories = new Lang.Class({
Name: "Directories",

/**
Expand Down Expand Up @@ -116,7 +116,7 @@ let Directories = new Lang.Class({
}
});

let Network = new Lang.Class({
var Network = new Lang.Class({
Name: "Network",

/**
Expand All @@ -138,7 +138,7 @@ let Network = new Lang.Class({
}
});

let Swap = new Lang.Class({
var Swap = new Lang.Class({
Name: "Swap",

_init: function(id) {
Expand Down
2 changes: 1 addition & 1 deletion [email protected]/view.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const FactoryModule = Me.imports.factory;
const Convenience = Me.imports.convenience;
const PrefsKeys = Me.imports.prefs_keys;

const Menu = new Lang.Class({
var Menu = new Lang.Class({
Name: 'Menu',
Extends: PanelMenu.Button,
_icons: {},
Expand Down
20 changes: 10 additions & 10 deletions [email protected]/widget.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ let BaseMenuItem = new Lang.Class({
}
});

const ResourceTitleItem = new Lang.Class({
var ResourceTitleItem = new Lang.Class({
Name: "ResourceTitleItem",
Extends: BaseMenuItem,

Expand All @@ -128,7 +128,7 @@ const ResourceTitleItem = new Lang.Class({
}
});

const ProcessItem = new Lang.Class({
var ProcessItem = new Lang.Class({
Name: "ProcessItem",
Extends: BaseMenuItem,

Expand All @@ -137,7 +137,7 @@ const ProcessItem = new Lang.Class({
}
});

const MountItem = new Lang.Class({
var MountItem = new Lang.Class({
Name: "MountItem",
Extends: BaseMenuItem,

Expand All @@ -146,7 +146,7 @@ const MountItem = new Lang.Class({
}
});

const StateItem = new Lang.Class({
var StateItem = new Lang.Class({
Name: "StateItem",
Extends: BaseMenuItem,

Expand All @@ -155,7 +155,7 @@ const StateItem = new Lang.Class({
}
});

const InterfaceItem = new Lang.Class({
var InterfaceItem = new Lang.Class({
Name: "InterfaceItem",
Extends: BaseMenuItem,

Expand Down Expand Up @@ -251,7 +251,7 @@ const Separator = new Lang.Class({
Extends: PopupMenu.PopupSeparatorMenuItem
});

const MeterAreaContainer = new Lang.Class({
var MeterAreaContainer = new Lang.Class({
Name: "MeterAreaContainer",
Extends: St.BoxLayout,

Expand Down Expand Up @@ -320,7 +320,7 @@ const MeterContainer = new Lang.Class({
}
});

const ProcessItemsContainer = new Lang.Class({
var ProcessItemsContainer = new Lang.Class({
Name: "ProcessItemsContainer",
Extends: MeterContainer,

Expand All @@ -342,7 +342,7 @@ const ProcessItemsContainer = new Lang.Class({
}
});

const SystemLoadItemsContainer = new Lang.Class({
var SystemLoadItemsContainer = new Lang.Class({
Name: "SystemLoadItemsContainer",
Extends: MeterContainer,

Expand All @@ -362,7 +362,7 @@ const SystemLoadItemsContainer = new Lang.Class({
}
});

const DirectoriesContainer = new Lang.Class({
var DirectoriesContainer = new Lang.Class({
Name: "DirectoriesContainer",
Extends: MeterContainer,

Expand All @@ -389,7 +389,7 @@ const DirectoriesContainer = new Lang.Class({
}
});

const NetworkInterfaceItemsContainer = new Lang.Class({
var NetworkInterfaceItemsContainer = new Lang.Class({
Name: "NetworkInterfaceItemsContainer",
Extends: MeterContainer,

Expand Down

0 comments on commit 20b7111

Please sign in to comment.