I've had a look through a number of posts and none seem to simply answer this.
I'm using Blockly as a rules editor.
I want to pass in x and y values (example names) to generated JS code.
The generated JS code already generates declarations for all variables e.g. 'var x,y'.
Is there a way to turn off declarations, or a custom variable block that doesn't result in var declarations?
The generated code will then be wrapped in a "function(x,y) { <code> }" and called with input var.
Looking through javascript generator source it looks like variables returned from getAllVariables() always results in declarations in Blockly.Javascript.init().
Thinking I might have to modify Blockly.Javascript.init() to achieve this, testing for a special var type maybe?
Alternatively I guess I can just strip out var declarations from the generated code, using Esprima/Acorn maybe..