extensionUtils: Remove ShellJS library

You can define a new importer object by importing a subdirectory in GJS.
This is undocumented, but it is likely to at least hold until the whole
thing moves to ES6 modules, after which we'll be able to do this purely
in JS with Reflect.Loader.

Since this was the only thing the ShellJS library did, we can remove it
altogether.

This allows us to discontinue use of the gjs-internals-1.0 embedder API.

https://bugzilla.gnome.org/show_bug.cgi?id=772386
This commit is contained in:
Philip Chimento
2016-10-04 22:27:18 -07:00
committed by Philip Chimento
parent c9ad54cd82
commit ed99bef458
6 changed files with 10 additions and 161 deletions

View File

@ -6,9 +6,7 @@
const Lang = imports.lang;
const Signals = imports.signals;
const GLib = imports.gi.GLib;
const Gio = imports.gi.Gio;
const ShellJS = imports.gi.ShellJS;
const Config = imports.misc.config;
const FileUtils = imports.misc.fileUtils;
@ -151,12 +149,13 @@ function createExtensionObject(uuid, dir, type) {
return extension;
}
var _extension = null;
function installImporter(extension) {
_extension = extension;
ShellJS.add_extension_importer('imports.misc.extensionUtils._extension', 'imports', extension.path);
_extension = null;
let oldSearchPath = imports.searchPath.slice(); // make a copy
imports.searchPath = [extension.path];
// importing a "subdir" creates a new importer object that doesn't affect
// the global one
extension.imports = imports['.'];
imports.searchPath = oldSearchPath;
}
const ExtensionFinder = new Lang.Class({