cleanup: Port non-GObject classes to JS6 classes

ES6 finally adds standard class syntax to the language, so we can
replace our custom Lang.Class framework with the new syntax. Any
classes that inherit from GObject will need special treatment,
so limit the port to regular javascript classes for now.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/361
This commit is contained in:
Florian Müllner
2017-10-31 02:19:44 +01:00
committed by Georges Basile Stavracas Neto
parent 99ce3deeb0
commit bacfdbbb03
102 changed files with 3454 additions and 4183 deletions

View File

@ -3,7 +3,6 @@
// Common utils for the extension system and the extension
// preferences tool
const Lang = imports.lang;
const Signals = imports.signals;
const Gio = imports.gi.Gio;
@ -160,9 +159,7 @@ function installImporter(extension) {
imports.searchPath = oldSearchPath;
}
var ExtensionFinder = new Lang.Class({
Name: 'ExtensionFinder',
var ExtensionFinder = class {
_loadExtension(extensionDir, info, perUserDir) {
let fileType = info.get_file_type();
if (fileType != Gio.FileType.DIRECTORY)
@ -184,7 +181,7 @@ var ExtensionFinder = new Lang.Class({
return;
}
this.emit('extension-found', extension);
},
}
scanExtensions() {
let perUserDir = Gio.File.new_for_path(global.userdatadir);
@ -192,5 +189,5 @@ var ExtensionFinder = new Lang.Class({
this._loadExtension(dir, info, perUserDir);
});
}
});
};
Signals.addSignalMethods(ExtensionFinder.prototype);