This PR is identical to #6 (please read the comments there first) except it has an additional commit giving blockly access to the global scope.
Though trying to guard global is a noble aim, Blockly really wants access to global. There's a whole load of stuff it accesses off of it including eval, setTimeout, atob, JSON etc. We can try and pass each of these through on the that object but I think it'll be a losing battle. I think just giving it access to global directly would be best, so this last commit does that and recompiles.
This PR is identical to #6 (please read the comments there first) except it has an additional commit giving blockly access to the global scope.
Though trying to guard
global
is a noble aim, Blockly really wants access to global. There's a whole load of stuff it accesses off of it includingeval
,setTimeout
,atob
,JSON
etc. We can try and pass each of these through on thethat
object but I think it'll be a losing battle. I think just giving it access to global directly would be best, so this last commit does that and recompiles.