GNOME Bugzilla – Bug 662967
Repeat of versions check in extensionSystem.js
Last modified: 2011-10-28 20:13:21 UTC
Why the double check for Shell/JavaScript versions in extensionSystem.js? The second check does not appear to be doing anything new except setting meta.state. Surely this code could be improved to remove the second check. if (!versionCheck(meta['shell-version'], Config.PACKAGE_VERSION) || (meta['js-version'] && !versionCheck(meta['js-version'], Config.GJS_VERSION))) { logExtensionError(uuid, 'extension is not compatible with current GNOME Shell and/or GJS version'); return; } extensionMeta[uuid] = meta; meta.type = type; meta.dir = dir; meta.path = dir.get_path(); meta.error = ''; // Default to error, we set success as the last step meta.state = ExtensionState.ERROR; if (!versionCheck(meta['shell-version'], Config.PACKAGE_VERSION) || (meta['js-version'] && !versionCheck(meta['js-version'], Config.GJS_VERSION))) { logExtensionError(uuid, 'extension is not compatible with current GNOME Shell and/or GJS version', ExtensionState.OUT_OF_DATE); meta.state = ExtensionState.OUT_OF_DATE; return; }
Created attachment 200207 [details] [review] extensionSystem: Remove duplciated version check This piece of accidentally duplicated code made sure that the OUT_OF_DATE status was never set. Good catch.
Review of attachment 200207 [details] [review]: Looks good to me.
Attachment 200207 [details] pushed as 203c5db - extensionSystem: Remove duplciated version check