コミットメタ情報

リビジョン0116e53c9696d2854070b652f22a2112ad374f28 (tree)
日時2013-12-13 22:11:30
作者argius <argius.net@gmai...>
コミッターargius

ログメッセージ

[#32529] change the method to get ScriptEngine, from ScriptEngineManager#getEngineByName to getEngineByExtension

変更サマリ

差分

--- a/src/net/argius/stew/CommandProcessor.java
+++ b/src/net/argius/stew/CommandProcessor.java
@@ -133,7 +133,7 @@ final class CommandProcessor {
133133 }
134134 log.debug("-s %s", file.getAbsolutePath());
135135 ScriptEngineManager factory = new ScriptEngineManager();
136- ScriptEngine engine = factory.getEngineByName("JavaScript");
136+ ScriptEngine engine = factory.getEngineByExtension(Path.getExtension(file));
137137 engine.put("connection", env.getCurrentConnection());
138138 engine.put("conn", env.getCurrentConnection());
139139 engine.put("patameter", p);
@@ -143,7 +143,6 @@ final class CommandProcessor {
143143 try {
144144 Reader r = new FileReader(file);
145145 try {
146- engine.eval("function using(o, f) { f(o); o.close() }");
147146 engine.eval(r);
148147 } finally {
149148 r.close();
旧リポジトリブラウザで表示