Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Espruino alternative for function.name (used in function toActionObject() ) #13

Open
SimonGAndrews opened this issue Sep 9, 2021 · 2 comments

Comments

@SimonGAndrews
Copy link
Owner

Espruino does not seem to support function.name to return the name property of a function.
This gives an issue in the function toActionObject() , in that the type of a function action is always 'undefined'.
May not be a show stopper as xstate/fsm behaves similiarly when multiple actions are defined within an array in the machine definition. Further testing required.

image

@SimonGAndrews
Copy link
Owner Author

SimonGAndrews commented Sep 9, 2021

Investigation of an alternative pattern in Espruino is ongoing, raised a question on Espruino forum.
Alternative methods/Polyfills investigated to date rely on parsing the result of function.toString. Unfortunatley Espruino does not put the function name into the function.toString() output.
Continuing to test impact.

@opichals
Copy link

opichals commented Apr 6, 2022

Function.name is indeed not supported (yet?) - espruino/Espruino#1348

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants