aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoranekos2008-10-10 14:42:44 +0000
committeranekos2008-10-10 14:42:44 +0000
commitcf455a103bb772fc44c949d773ac927721f3111b (patch)
treee95eed759c1f0535a38c52aa9c9b2406f12f7b8f
parenta0603966a7b3ba5c07d137273f7d08f869021fe2 (diff)
downloadvimperator-plugins-cf455a103bb772fc44c949d773ac927721f3111b.tar.bz2
変数をお漏らししないように、{} で囲った。
git-svn-id: http://svn.coderepos.org/share/lang/javascript/vimperator-plugins/trunk@21090 d0d07461-0603-4401-acd4-de1884942a52
-rw-r--r--plugin_loader.js39
1 files changed, 20 insertions, 19 deletions
diff --git a/plugin_loader.js b/plugin_loader.js
index cc5190a..c9c36b0 100644
--- a/plugin_loader.js
+++ b/plugin_loader.js
@@ -17,27 +17,28 @@
// Link:
// http://d.hatena.ne.jp/nokturnalmortum/20081008#1223397705
+{
+ function toArray (obj) {
+ return obj instanceof Array ? obj
+ : obj.toString().split(/[,| \t\r\n]+/);
+ }
-function toArray (obj) {
- return obj instanceof Array ? obj
- : obj.toString().split(/[,| \t\r\n]+/);
-}
-
-let roots = toArray(globalVariables.plugin_loader_roots);
-let plugins = toArray(globalVariables.plugin_loader_plugins);
-let filter = new RegExp('[\\\\/](?:' +
- plugins.map(function (plugin) plugin.replace(/(?=[\\^$.+*?|(){}\[\]])/g, '\\'))
- .join('|') +
- ')\\.(?:js|vimp)$');
+ let roots = toArray(globalVariables.plugin_loader_roots);
+ let plugins = toArray(globalVariables.plugin_loader_plugins);
+ let filter = new RegExp('[\\\\/](?:' +
+ plugins.map(function (plugin) plugin.replace(/(?=[\\^$.+*?|(){}\[\]])/g, '\\'))
+ .join('|') +
+ ')\\.(?:js|vimp)$');
-log('plugin_loader: loading');
+ log('plugin_loader: loading');
-roots.forEach(function (root) {
- let files = io.readDirectory(io.getFile(root), true);
- files.forEach(function (file) {
- if (filter.test(file.path))
- liberator.io.source(file.path, false);
+ roots.forEach(function (root) {
+ let files = io.readDirectory(io.getFile(root), true);
+ files.forEach(function (file) {
+ if (filter.test(file.path))
+ liberator.io.source(file.path, false);
+ });
});
-});
-log('plugin_loader: loaded');
+ log('plugin_loader: loaded');
+}