CompileModule returns a compiled bytecode with given code and module name.
(filePath string, moduleName string, opts ...EvalOption)
| 1041 | |
| 1042 | // CompileModule returns a compiled bytecode with given code and module name. |
| 1043 | func (ctx *Context) CompileModule(filePath string, moduleName string, opts ...EvalOption) ([]byte, error) { |
| 1044 | opts = append(opts, EvalFileName(moduleName)) |
| 1045 | return ctx.CompileFile(filePath, opts...) |
| 1046 | } |
| 1047 | |
| 1048 | // LoadModuleBytecode returns a js value from the given bytecode. |
| 1049 | // Only load bytecode produced by a trusted source. QuickJS bytecode is not a |