code: function(newStatement) {
      var oldStatement = !this.outputConnection;
      if (newStatement != oldStatement) {
        this.unplug(true, true);
        if (newStatement) {
          this.setOutput(false);
          this.setPreviousStatement(true);
          this.setNextStatement(true);
        } else {
          this.setPreviousStatement(false);
          this.setNextStatement(false);
          this.setOutput(true);
        }
      }
    }
docs: Switch between a value block and a statement block.
  @param {boolean} newStatement True if the block should be a statement.
  False if the block should be a value.
  @private
  @this Blockly.Block