Skip to content

[Question] Duktape coroutine and builtins #2571

@zheng-yu-yang

Description

@zheng-yu-yang

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions