Closed tommasodargenio closed 2 years ago
s.status
does not return a callable string. it would return
'status() {\n' +
" console.log('test fecth data' + ' ' + Date().toString());\n" +
' }'
This is a limitation of Worker Threads and NodeJS so there isn't a lot we can do about it. you would need to define the function outside of a class or use a wrapper function to define and call the class.
The function feature is only provided for simplistic use and really should be avoided as it uses eval
which can have security implications.
Describe the bug
Actual behavior
When calling an object.method as function I get an exception, if I use a normal function instead it works without issues.
Expected behavior
I would expect to see the s.status() method to be invoked every 5s, as it would if using a normal function
Code to reproduce
Checklist