Forráskód Böngészése

Provide module resolver for oc.compile()

Vladislav Folts 8 éve
szülő
commit
e25413ba63
1 módosított fájl, 3 hozzáadás és 2 törlés
  1. 3 2
      src/oc.js

+ 3 - 2
src/oc.js

@@ -130,7 +130,7 @@ function compileModules(names, moduleReader, grammar, contextFactory, handleErro
     return success;
 }
 
-function compile(text, language, handleErrors, options){
+function compile(text, language, handleErrors, options, moduleReader){
     var result = "";
     var rtl = new makeRTL(language.rtl);
     var moduleCode = function(name, imports){return new Code.ModuleGenerator(name, imports);};
@@ -147,7 +147,8 @@ function compile(text, language, handleErrors, options){
                     });
             },
             function(name, code){result += code;},
-            handleErrors
+            handleErrors,
+            moduleReader
             );
     resolver.compile(text);