Browse Source

无JIRA任务 JS格式化导致死机

master
richie 6 years ago
parent
commit
8186642399
  1. 2
      designer-base/src/com/fr/design/javascript/beautify/JavaScriptFormatHelper.java
  2. 3255
      designer-base/src/com/fr/design/javascript/beautify/beautify.js

2
designer-base/src/com/fr/design/javascript/beautify/JavaScriptFormatHelper.java

@ -40,7 +40,7 @@ public class JavaScriptFormatHelper {
Reader reader = new InputStreamReader(resourceAsStream); Reader reader = new InputStreamReader(resourceAsStream);
scriptEngine.eval(reader); scriptEngine.eval(reader);
Invocable invocable = (Invocable) scriptEngine; Invocable invocable = (Invocable) scriptEngine;
result = (String) invocable.invokeFunction("js_beautify", jsCode, option.toFormatArgument()); result = (String) invocable.invokeFunction("js_beautify_global", jsCode, option.toFormatArgument());
} catch (ScriptException | NoSuchMethodException e) { } catch (ScriptException | NoSuchMethodException e) {
FineLoggerFactory.getLogger().error(e.getMessage(), e); FineLoggerFactory.getLogger().error(e.getMessage(), e);
} }

3255
designer-base/src/com/fr/design/javascript/beautify/beautify.js

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save