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

[Question] Duktape coroutine and builtins #2571

Open
zheng-yu-yang opened this issue Jun 28, 2024 · 0 comments
Open

[Question] Duktape coroutine and builtins #2571

zheng-yu-yang opened this issue Jun 28, 2024 · 0 comments

Comments

@zheng-yu-yang
Copy link

Hi there,

Recently I had an issue that Duktape.thread.yeild did not work by throwing the exception TypeError: invalid state. After some investigation it turned out that an Array.forEach (a native method) in the coroutine's stack prevented the yielding. By replacing the native forEach with a JS version yielding worked again.

With some analysis, all built-ins which take JS callbacks are not safe.

My question is, when I want to use Duktape coroutine and allow all ES5 facilitates, do I have to replace all such built-ins with JS implementation? Is there a list of them?

Thanks.

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

1 participant