Skip to content

Commit

Permalink
Publishing again
Browse files Browse the repository at this point in the history
  • Loading branch information
ackava committed Apr 9, 2024
1 parent 08c6ccb commit 978ddfe
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions YantraJS.Core/Core/Module/JSModuleContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -377,8 +377,10 @@ protected virtual async Task<JSValue> LoadModuleAsync(string currentPath, string

internal protected virtual async Task CompileModuleAsync(JSModule module)
{

// Console.WriteLine($"{DateTime.Now} - Compiling module {module.filePath}");
var filePath = module.filePath;

// if this is a json file... then pad with module.exports =
if (module.Code == null)
{
Expand All @@ -392,10 +394,10 @@ internal protected virtual async Task CompileModuleAsync(JSModule module)
{
code = $"module.exports = {code};";
}
else
{
// code = @$"(async function({{module, import, exports, require, filePath: __filename, dirPath: __dirname}}) {{ return (\r\n{code}\r\n); }})";
}
// else
// {
// code = @$"(async function({{module, import, exports, require, filePath: __filename, dirPath: __dirname}}) {{ return (\r\n{code}\r\n); }})";
// }

// var factory = FastEval(code, filePath);
var factory = CoreScript.Compile(code, module.filePath, new string[]
Expand Down

0 comments on commit 978ddfe

Please sign in to comment.