Hi,
Could anyone possibly offer some solutions they’ve found as to how we can more easily apply our “call JS” app.ExternalInterface functions?
I’ve used the technique of:
return js code here
And the technique:
function code(block) {
var fun = Blockly.JavaScript.provideFunction_(‘myFunction’, [`
function ${Blockly.JavaScript.FUNCTION_NAME_PLACEHOLDER_}(a, b, c) {
console.log(a, b, c);
}
`]);
return ${fun}(1, 2, 3);
;
}
Sorry the tics in the .block code breaks up the markup here.
However, there seems to be problems in both.
Custom puzzles keep saying they’re malformed, error ridden.
If anyone has solutions, I’d love to hear your methods.
Thanks!
Edit: or possibly importing functions from other js files?
(I find the .block format difficult to go “straight-to” JavaScript ONLY parsing …then back.
I’ve been reviewing the blockly docs but no dice. )
Or should we work on using the “JS-Interpreter” (acorn_interpreter.js) from GitHub?