Code Monkey home page Code Monkey logo

Comments (7)

dbuenzli avatar dbuenzli commented on July 25, 2024 1

Thanks, this has been fixed in dbuenzli/brr@5b1dbed. It seems I missed that in the PR by Jérôme and subsequent commit of mine that was supposed to sanitize all that.

from js_of_ocaml.

vouillon avatar vouillon commented on July 25, 2024

There is a bug in prr.
In file fut.ml, the definition of tick should be:

let tick ~ms =
  fut @@ Jv.Promise.create @@ fun res _rej ->
  ignore (Jv.apply (Jv.get Jv.global "setTimeout") Jv.[| callback ~arity:1 res; of_int ms |])

from js_of_ocaml.

haochenx avatar haochenx commented on July 25, 2024

@vouillon many thanks for taking time to look into it. I just applied your suggested fix and now the test passes!

As prr is merely a fork (and out-of-date version) of brr and it seems that brr still has the same code, we will open a bug report on brr as well.

Do you mind to share how you traced the root cause down? We found it quite difficult to trace such bugs as stack trace isn't very helpful (even if source map is on..)

from js_of_ocaml.

vouillon avatar vouillon commented on July 25, 2024

This looked like a calling convention mismatch (an OCaml function called from JavaScript as if it was a JavaScript function).
The error was in some prr code related to promises (function Jv.Promise.create), and indeed in a callback.
And the stack trace mentions Timeout._onTimeout, so I searched for a setTimeout.

from js_of_ocaml.

haochenx avatar haochenx commented on July 25, 2024

Wow that's impressive and thanks for the hint!

Fixing fut.ml made our codebase all worked again. I think this issue can be closed as it's now apparent that it's due to a misuse instead of a bug in jsoo.

(@kxc-wraikny opened this issue on behalf of our team but @kxc-wraikny is taking a break until Mar 28;
so I will be handing the communication until then.)

from js_of_ocaml.

vouillon avatar vouillon commented on July 25, 2024

Thanks, this has been fixed in dbuenzli/brr@5b1dbed. It seems I missed that in the PR by Jérôme and subsequent commit of mine that was supposed to sanitize all that.

@dbuenzli Thanks! I think I missed it in my PR as well.

from js_of_ocaml.

haochenx avatar haochenx commented on July 25, 2024

Thank you all again!

from js_of_ocaml.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.