code: function() {
      var TYPES =
          [[Blockly.Msg.TEXT_PROMPT_TYPE_TEXT, 'TEXT'],
           [Blockly.Msg.TEXT_PROMPT_TYPE_NUMBER, 'NUMBER']];
      // Assign 'this' to a variable for use in the closure below.
      var thisBlock = this;
      this.setHelpUrl(Blockly.Msg.TEXT_PROMPT_HELPURL);
      this.setColour(Blockly.Blocks.texts.HUE);
      var dropdown = new Blockly.FieldDropdown(TYPES, function(newOp) {
        thisBlock.updateType_(newOp);
      });
      this.appendDummyInput()
          .appendField(dropdown, 'TYPE')
          .appendField(this.newQuote_(true))
          .appendField(new Blockly.FieldTextInput(''), 'TEXT')
          .appendField(this.newQuote_(false));
      this.setOutput(true, 'String');
      // Assign 'this' to a variable for use in the tooltip closure below.
      var thisBlock = this;
      this.setTooltip(function() {
        return (thisBlock.getFieldValue('TYPE') == 'TEXT') ?
            Blockly.Msg.TEXT_PROMPT_TOOLTIP_TEXT :
            Blockly.Msg.TEXT_PROMPT_TOOLTIP_NUMBER;
      });
    }
docs: Block for prompt function (internal message).
  The 'text_prompt_ext' block is preferred as it is more flexible.
  @this Blockly.Block