ioBroker.javascript icon indicating copy to clipboard operation
ioBroker.javascript copied to clipboard

[Bug]: /lib/javascript.d.ts - Zeile 1222

Open Quarkmax opened this issue 1 year ago • 2 comments

I'm sure that

  • [X] This issue is still present in the current beta version of this adapter
  • [X] There is no other (open) issue with the same topic (use the search!)
  • [X] This issue is not described in the adapter documentation / FAQ (read the docs!)

Script type

JavaScript

The problem

Senden an anderes Script (JS, nicht Blockly) erwartet einen String für die Instanz messageTo({ instance: 0, script: ....... . Übergebe ich die Instanz als String '0' oder "0" wird die Message nicht gesendet. Sollte hier in Zeile 1222 instance?: string; nicht number erwartet werden? Grundsätzlich ist die Funktion gegeben wenn man die Instanz als Number übergibt, aber unschön wegen des Hinweises beim schreiben.

iobroker.current.log (in debug mode!)

No response

Version of nodejs

20.18.0

Version of ioBroker js-controller

7.0.2

Version of adapter

8.8.3

Quarkmax avatar Nov 13 '24 15:11 Quarkmax

Documentation is also a string - the idea is that you provide the complete namespace. e.g. javascript.0:

https://github.com/ioBroker/ioBroker.javascript/blob/840d03855636c4271971afc202532d008c22d264/docs/en/javascript.md?plain=1#L1725-L1726

But yes, number should also work:

https://github.com/ioBroker/ioBroker.javascript/blob/840d03855636c4271971afc202532d008c22d264/lib/sandbox.js#L4089-L4094

klein0r avatar Nov 15 '24 08:11 klein0r

javascript.0 works without any problems, send and no red underlined. I had the snippet translated from Blockly, and it only said instance: 0

Quarkmax avatar Nov 15 '24 16:11 Quarkmax