title: Blockly repeat block not working with both custom block and predefined blocks
body: <p>I'm working on an Angular project using Blockly and Phaser but repeat block is not working. Here is a small test to print <code>aa</code> 3 times.</p>
  <p><img src="https://i.stack.imgur.com/jxPi0.jpg" alt="enter image description here" /></p>
  <p>But I received this error:</p>
  <p><img src="https://i.stack.imgur.com/zi87H.png" alt="JavaScript error message" /></p>
  <p>Here is the code used:</p>
  <pre><code> &lt;block type=&quot;controls_repeat_ext&quot;&gt;
       &lt;value name=&quot;TIMES&quot;&gt;
           &lt;shadow type=&quot;math_number&quot;&gt;
               &lt;field name=&quot;NUM&quot;&gt;3&lt;/field&gt;
           &lt;/shadow&gt;
       &lt;/value&gt;
   &lt;/block&gt;
   //and for the function 
    
   run.on(event.POINTER_DOWN ,(image) =&gt; {
       eval(document.getElementById('code').innerHTML);
       console.log(&quot;running&quot; )
   });
  </code></pre>
  <p>What should I add to make this repeat work?</p>