diff options
author | suVene | 2008-12-10 14:38:35 +0000 |
---|---|---|
committer | suVene | 2008-12-10 14:38:35 +0000 |
commit | 7a82092fb513d03ba0e6bf5902e1cb812c728601 (patch) | |
tree | 76e4a4bd3009803e4285fa0cefdffb23449a6013 /_libly.js | |
parent | 4dd0b7bfef72f78c754fef56bbc5eb14ca38b074 (diff) | |
download | vimperator-plugins-7a82092fb513d03ba0e6bf5902e1cb812c728601.tar.bz2 |
* bugfix.(Request tranceport status)
* mod $U.A() for arguments.
git-svn-id: http://svn.coderepos.org/share/lang/javascript/vimperator-plugins/trunk@26326 d0d07461-0603-4401-acd4-de1884942a52
Diffstat (limited to '_libly.js')
-rw-r--r-- | _libly.js | 16 |
1 files changed, 9 insertions, 7 deletions
@@ -5,7 +5,7 @@ var PLUGIN_INFO = <description>vimperator plugins library?</description> <description lang="ja">適当なライブラリっぽいものたち。</description> <author mail="suvene@zeromemory.info" homepage="http://zeromemory.sblo.jp/">suVene</author> - <version>0.1.4</version> + <version>0.1.5</version> <minVersion>1.2</minVersion> <maxVersion>2.0pre</maxVersion> <detail><![CDATA[ @@ -100,12 +100,13 @@ libly.$U = {//{{{ dst[prop] = src[prop]; return dst; }, - A: function(hash, iter) { + A: function(iterable) { var ret = []; - if (typeof hash == 'undefined') return ret; - if (typeof hash == 'string') return [hash]; - if (hash.toArray) return hash.toArray(); - for each (let item in hash) ret.push(item); + if (typeof iterable == 'undefined') return ret; + if (typeof iterable == 'string') return [iterable]; + if (!(typeof iterable == 'function' && iterable == '[object NodeList]') && + iterable.toArray) return iterable.toArray(); + for (let i = 0, len = iterable.length || 0; i < len; ret.push(iterable++)); return ret; }, bind: function(obj, func) { @@ -121,7 +122,7 @@ libly.$U = {//{{{ if (Components.utils.evalInSandbox('true', sandbox) === true) { fnc = function(text) { return Components.utils.evalInSandbox(text, sandbox); }; } - } catch (e) { liberator.log('warning: multi_requester.js is working with unsafe sandbox.'); } + } catch (e) { liberator.log('warning: _libly.js is working with unsafe sandbox.'); } return fnc(text); }, @@ -312,6 +313,7 @@ libly.Request.prototype = { } catch (e) { return 0; } }, isSuccess: function() { + var status = this.getStatus(); return !status || (status >= 200 && status < 300); }, respondToReadyState: function(readyState) { |