[gnome-shell] extensionSystem: Make the init function optional
- From: Jasper St. Pierre <jstpierre src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell] extensionSystem: Make the init function optional
- Date: Tue, 12 Jun 2012 21:17:03 +0000 (UTC)
commit 0805d7a35ffa06a5d4b99f9a0e0cd38ac6c6a786
Author: Jasper St. Pierre <jstpierre mecheye net>
Date: Mon Jun 4 18:43:52 2012 -0400
extensionSystem: Make the init function optional
A large amount of extensions have something like this in them:
function init() {}
Since we have encouraged extension authors to try and not make any
changes in init, it feels weird and strange to have to create an
initialization function that does nothing. From now on, don't require
it.
https://bugzilla.gnome.org/show_bug.cgi?id=677586
js/ui/extensionSystem.js | 17 +++++++----------
1 files changed, 7 insertions(+), 10 deletions(-)
---
diff --git a/js/ui/extensionSystem.js b/js/ui/extensionSystem.js
index cb205a7..35b02a4 100644
--- a/js/ui/extensionSystem.js
+++ b/js/ui/extensionSystem.js
@@ -190,16 +190,13 @@ function initExtension(uuid) {
return;
}
- if (!extensionModule.init) {
- logExtensionError(uuid, 'missing \'init\' function');
- return;
- }
-
- try {
- extensionState = extensionModule.init(extension);
- } catch (e) {
- logExtensionError(uuid, 'Failed to evaluate init function:' + e);
- return;
+ if (extensionModule.init) {
+ try {
+ extensionState = extensionModule.init(extension);
+ } catch (e) {
+ logExtensionError(uuid, 'Failed to evaluate init function:' + e);
+ return;
+ }
}
if (!extensionState)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]