[extensions-web] js: Remove unused versionCheck function
- From: Jasper St. Pierre <jstpierre src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [extensions-web] js: Remove unused versionCheck function
- Date: Thu, 29 Mar 2012 21:48:37 +0000 (UTC)
commit bfaa36b234d96bdb40fbf63616669519af2f1b6d
Author: Jasper St. Pierre <jstpierre mecheye net>
Date: Thu Mar 29 06:35:15 2012 -0400
js: Remove unused versionCheck function
sweettooth/static/js/extensionUtils.js | 19 +------------------
sweettooth/static/js/test/extensions.js | 14 --------------
2 files changed, 1 insertions(+), 32 deletions(-)
---
diff --git a/sweettooth/static/js/extensionUtils.js b/sweettooth/static/js/extensionUtils.js
index fd2e1b8..c15d6a0 100644
--- a/sweettooth/static/js/extensionUtils.js
+++ b/sweettooth/static/js/extensionUtils.js
@@ -4,8 +4,7 @@ define([], function() {
var module = {};
- // ExtensionState and versionCheck are stolen and should
- // be kept in sync those from the Shell.
+ // ExtensionState is stolen and should be kept in sync with the Shell.
// Licensed under GPL2+
// See: http://git.gnome.org/browse/gnome-shell/tree/js/ui/extensionSystem.js
@@ -22,22 +21,6 @@ define([], function() {
UNINSTALLED: 99
};
- module.versionCheck = function(required, current) {
- var currentArray = current.split('.');
- var major = currentArray[0];
- var minor = currentArray[1];
- var point = currentArray[2];
- for (var i = 0; i < required.length; i++) {
- var requiredArray = required[i].split('.');
- if (requiredArray[0] == major &&
- requiredArray[1] == minor &&
- (requiredArray[2] == point ||
- (requiredArray[2] == undefined && parseInt(minor) % 2 == 0)))
- return true;
- }
- return false;
- };
-
module.grabProperExtensionVersion = function(map, current) {
if (!map)
return null;
diff --git a/sweettooth/static/js/test/extensions.js b/sweettooth/static/js/test/extensions.js
index c5835a0..681901d 100644
--- a/sweettooth/static/js/test/extensions.js
+++ b/sweettooth/static/js/test/extensions.js
@@ -1,19 +1,5 @@
require(['extensionUtils', 'jquery', 'test/qunit'], function(extensionUtils) {
- var versionCheck = extensionUtils.versionCheck;
- test("versionCheck", function() {
- equal(versionCheck(["3.2.1"], "3.2.1"), true, "testing basic capability");
- equal(versionCheck(["3.3.1"], "3.2.1"), false);
-
- equal(versionCheck(["3.3.1", "3.2.1"], "3.2.1"), true, "multiple versions");
- equal(versionCheck(["3.3.1", "3.3.2"], "3.2.1"), false);
-
- equal(versionCheck(["3.2"], "3.2.1"), true, "stable release checking");
- equal(versionCheck(["3.3"], "3.3.1"), false);
-
- equal(versionCheck(["3.2.2"], "3.2.2.1"), true, "ignoring the fourth field");
- });
-
var grabProperExtensionVersion = extensionUtils.grabProperExtensionVersion;
test("grabProperExtensionVersion", function() {
var map = { "3.0": { version: 1, pk: 1 },
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]