Skip to content

Latest commit

 

History

History
22 lines (19 loc) · 1.25 KB

README.md

File metadata and controls

22 lines (19 loc) · 1.25 KB

RhinoRequire.js

© 2020-2022 Dark Tornado, All rights reserved.

How to use? / 사용법

  • Execute require.js via .evaluateString(); method in org.mozilla.javascript.Context class before executing your source.
  • 다른 소스를 실행하기 전에 org.mozilla.javascript.Context 클래스에 있는 .evaluateString(); 메소드 등을 통해 require.js을 실행하면 되는거에요.

Example / 예시

org.mozilla.javascript.Context rhino = org.mozilla.javascript.Context.enter();
rhino.setOptimizationLevel(-1);
rhino.setLanguageVersion(org.mozilla.javascript.Context.VERSION_ES6);
Scriptable scope = new ImporterTopLevel(rhino);  //or Scriptable scope = rhino.initStandardObjects();
rhino.evaluateString(scope, "require.js's source", "JavaScript", 1, null);  //Execute require.js before executing your source.
rhino.evaluateString(scope, "Your JS Source", "JavaScript", 1, null);
org.mozilla.javascript.Context.exit();

License / 라이선스