- 
          
- 
                Notifications
    You must be signed in to change notification settings 
- Fork 11
Open
Labels
Description
Is your feature request related to a problem? Please describe.
Now methods of modules can work with with primitives and objects only, bun no with a functions.
Code below throw Error, because postMessage no work with function:
(async () => {
  const res = await module1.method1(x => x ** x);
  console.log({ res });
})();Describe the solution you'd like
There an idea of implementation with vm: https://github.com/Wansmer/noroutine/pull/1
But there is open questions:
- Is a good approach to create new sandbox for every higher order function?
- Is need disable modules like osandfsfor safety or user must make decision himself? (set flags in options or generate and pass own context, for example);
- If 'dangerous' code not expected (from end user), maybe evalin this case will be better and lighter solution insteadvm.Script?