title: illegal use of undefined variable, class, or 'void' literal
body: <p>I am getting below exception whenever trying to call JavaScript Function using below code:</p>
  
  <blockquote>
    <p>Assertion failure message: org.apache.jorphan.util.JMeterException: Error invoking bsh method: eval   Sourced file: inline evaluation of: ``vars.put("FinalData", decode64(PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiI . . . '' : illegal use of undefined variable, class, or 'void' literal</p>
  </blockquote>
  
  <p>Below is the BSFPostProcess:</p>
  
  <pre><code>function decode64(input) {
       var output = "";
       var chr1, chr2, chr3 = "";
       var enc1, enc2, enc3, enc4 = "";
       var i = 0;
  
       // remove all characters that are not A-Z, a-z, 0-9, +, /, or =
       var base64test = /[^A-Za-z0-9\+\/\=]/g;
       if (base64test.exec(input)) {
          alert("There were invalid base64 characters in the input text.\n" +
                "Valid base64 characters are A-Z, a-z, 0-9, '+', '/',and '='\n" +
                "Expect errors in decoding.");
       }
       input = input.replace(/[^A-Za-z0-9\+\/\=]/g, "");
  
       do {
          enc1 = keyStr.indexOf(input.charAt(i++));
          enc2 = keyStr.indexOf(input.charAt(i++));
          enc3 = keyStr.indexOf(input.charAt(i++));
          enc4 = keyStr.indexOf(input.charAt(i++));
  
          chr1 = (enc1 &lt;&lt; 2) | (enc2 &gt;&gt; 4);
          chr2 = ((enc2 &amp; 15) &lt;&lt; 4) | (enc3 &gt;&gt; 2);
          chr3 = ((enc3 &amp; 3) &lt;&lt; 6) | enc4;
  
          output = output + String.fromCharCode(chr1);
  
          if (enc3 != 64) {
             output = output + String.fromCharCode(chr2);
          }
          if (enc4 != 64) {
             output = output + String.fromCharCode(chr3);
          }
  
          chr1 = chr2 = chr3 = "";
          enc1 = enc2 = enc3 = enc4 = "";
  
       } while (i &lt; input.length);
       return output;
  }
  </code></pre>
  
  <p>I am trying to call this under BSF Assertion Sampler using below code.</p>
  
  <pre><code>vars.put("FinalData", decode64(${Data}));
  </code></pre>
  
  <p>OR </p>
  
  <pre><code>vars.put("FinalData", decode64(vars.get("Data")));
  </code></pre>
  
  <p>Data is variable and stores value:</p>
  
  <blockquote>
    <p>PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9InllcyI/Pgo8UmVxdWVzdFBhcnRzUmVzcG9uc2UgeG1sbnM9Imh0dHA6Ly9zZXJ2aWNlcy5teWNjY3BvcnRhbC5jb20vQWx0ZXJuYXRlUGFydFNvdXJjaW5nL0FsdGVybmF0ZVBhcnRTb3VyY2luZyI+CiAgICA8UGFydFJlcXVlc3RJZGVudGlmaWVyPjQwNTM4MTU8L1BhcnRSZXF1ZXN0SWRlbnRpZmllcj4KPC9SZXF1ZXN0UGFydHNSZXNwb25zZT4=</p>
  </blockquote>
  
  <p><code>FinalData</code> is predefined variable.</p>