Bug in Realm default function args + destructured assignment

Hello! Realm’s JS feature compatibility list says it supports both destructing assignment and default function parameters. The last example on MDN shows how these can be used together.

However, this appears to break in Realm functions:

exports = ({limit, offset} = {limit: 10, offset: 20}) => {
  console.log('limit', limit);
 }

In Realm Functions, clicking Run on this prints limit undefined instead of limit 10 as you would expect.

This is valid syntax in general. Let me know if there’s anything else I can do to help debug. :slight_smile:

It looks like you can do this inline. I think what I wrote in the first post is still supposed to work (or at least it does in Chrome?) but this works in Realm:

exports = ({limit = 10, offset = 20}) => {
  console.log('limit', limit);
 }