From e3062a292274ec5e6a94b5ed6e955126e0b4e5f8 Mon Sep 17 00:00:00 2001 From: suVene Date: Sun, 28 Dec 2008 21:57:21 +0000 Subject: 数値としての比較にする. git-svn-id: http://svn.coderepos.org/share/lang/javascript/vimperator-plugins/trunk@27537 d0d07461-0603-4401-acd4-de1884942a52 --- pluginManager.js | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'pluginManager.js') diff --git a/pluginManager.js b/pluginManager.js index fcf2be4..b92196f 100644 --- a/pluginManager.js +++ b/pluginManager.js @@ -235,6 +235,10 @@ function compVersion(a, b){ for (let [i, bv] in Iterator(b)) { var av = i < a.length ? a[i] : 0; if (av == bv) continue; + if (!isNaN(av) && !isNaN(bv)) { + av = parseInt(av); + bv = parseInt(bv); + } return av < bv ? -1 : 1; } return 0; -- cgit v1.2.3