Skip to content

Add instance toJSArgs JSONNode

Camil Staps requested to merge add-toJSArgs-instance-for-JSONNode into master

What does this MR do?

Adds a toJSArgs instance for JSONNode so that you can call JavaScript functions with a single JSONNode argument.

Unfortunately it is not possible to add an instance toJSArgs a | gToJS{|*|} a. This is allowed by the iTask compiler but not by the master compiler. Therefore we need to explicitly list the common types. JSONNode is sufficiently common when talking to JavaScript to include it here.

Apart from this, this MR reorders the instances a bit: (1) basic types; (2) JavaScript-related types; (3) container types.

Related issues

N/A

Changes to public APIs

Adds instance toJSArgs JSONNode.

Author's checklist (required)

See CONTRIBUTING.md for the rationale behind these items:

  • The commit history does not contain merges (use git rebase -i master if it does)
  • Intermediate commits compile (use git rebase -i master if not)
  • Newly added code has a style consistent with the existing code
  • Newly added code is documented
  • A changelog entry has been added if required. See CONTRIBUTING.md
  • If bugs have been solved, tests have been added
  • Appropriate types have been used, especially in APIs
  • If efficiency is part of the acceptance criteria of the issue, a benchmark is provided
  • If enum instruction in src/abc_instructions.h has changed, ABC_VERSION in src/settings.h has been increased
Edited by Camil Staps

Merge request reports