Javascript rest parameters, args gets cropped

Hey :wave:
I was working on creating some bindings for an external library (jest-dom) and I’m experiencing some strange behaviour when trying to pass down arguments to a js function that uses rest parameters.

ƒ throwingMatcher(...args)

This function internally expects 2 parameters, A and B
This function is called in my binding like this:

expect(other)["toHaveClass"](A, B)

When trying to debug, I can see that throwingMatcher is always called with only the A parameters and B is cropped out. The parameter is cropped in the app function inside the curry.js like this:

is this a known issue with rest parameters or is my binding for the function wrong?
Thanks in advance :slight_smile:

Try to change the bindings to:

expect(other)["toHaveClass"](. A, B)

This might be related: Why is this rescript object 'undefined' and how to fix this code? - #5 by DZakh

1 Like

Thanks! That solved my issue :pray: