title: Strange variable scoping behavior in Jenkinsfile
body: <p>When I run the below Jenkins pipeline script:</p>
  
  <pre><code>def some_var = "some value"
  
  def pr() {
      def another_var = "another " + some_var
      echo "${another_var}"
  }
  
  pipeline {
      agent any
  
      stages {
          stage ("Run") {
              steps {
                  pr()
              }
          }
      }
  }
  </code></pre>
  
  <p>I get this error:</p>
  
  <pre><code>groovy.lang.MissingPropertyException: No such property: some_var for class: groovy.lang.Binding
  </code></pre>
  
  <p>If the <code>def</code> is removed from <code>some_var</code>, it works fine. Could someone explain the scoping rules that cause this behavior?</p>