cleanup: Remove old compatibility code

Since gjs moved to mozjs60, return values of int8_t arrays can
no longer be treated as strings. We originally made the conversion
conditional to keep working with the (then) stable gjs release.

That was two years ago and we require a more recent gjs nowadays,
so there's no good reason for keeping the old code path.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1407
This commit is contained in:
Florian Müllner
2020-08-13 23:35:27 +02:00
committed by Georges Basile Stavracas Neto
parent 923d926345
commit 112b139a9e
5 changed files with 10 additions and 15 deletions

View File

@ -2,6 +2,7 @@
/* exported init connect disconnect */
const { GLib, Gio, GObject, Shell, St } = imports.gi;
const ByteArray = imports.byteArray;
const Signals = imports.signals;
const ExtensionDownloader = imports.ui.extensionDownloader;
@ -282,8 +283,7 @@ var ExtensionManager = class {
let metadataContents, success_;
try {
[success_, metadataContents] = metadataFile.load_contents(null);
if (metadataContents instanceof Uint8Array)
metadataContents = imports.byteArray.toString(metadataContents);
metadataContents = ByteArray.toString(metadataContents);
} catch (e) {
throw new Error('Failed to load metadata.json: %s'.format(e.toString()));
}