© 2020-2022 Dark Tornado, All rights reserved.
- require(); function made with Javascript for Rhino JS Engine.
- 자바스크립트로 구현된 라이노 엔진용 require(); 함수에요.
- Execute
require.js
via.evaluateString();
method inorg.mozilla.javascript.Context
class before executing your source. - 다른 소스를 실행하기 전에
org.mozilla.javascript.Context
클래스에 있는.evaluateString();
메소드 등을 통해require.js
을 실행하면 되는거에요.
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();