title: How vuejs knows the depenedencies of computed property for caching?
body: <p>I have this Vue.js code:</p>
  <pre><code>new Vue({
    data:{
           myValue:'x',
           myOtherValue:'y'
    },
    computed: {
         myComputed: myFunction(){
            return this['my' + 'Value']
         }
    }
  })
  </code></pre>
  <p>As you can see the computed property will be cached and it is depended only on <code>data.myValue</code>. My question is how Vue.js caching system knows that run the computed function again only if <code>myValue</code> is changed?</p>
  <p>If I change the <code>myOtherValue</code> variable, the <code>myComputed</code> function will use the cache, and will not be run again will I call it.</p>
  <p>I thought about several ways how it is possible. But how Vuejs doing that?
  I have read this article: <a href="https://v2.vuejs.org/v2/guide/computed.html" rel="nofollow noreferrer">https://v2.vuejs.org/v2/guide/computed.html</a> and found no answer.</p>
  <p>And what happen in this code, what it will be depeneded on?</p>
  <pre><code>const flag=2
  new Vue({
    data:{
           myValue:'x',
           myOtherValue:'y'
    },
    computed: {
         myComputed: myFunction(){
            if (flag==1){
                return this['my' + 'Value']
            }
            else
                return this['my' + 'Other' + 'Value']
         }
    }
  })
  </code></pre>
  <p><em>Bonus:</em> I will appreciate I link to the relevant function in the VueJS code: <a href="https://github.com/vuejs/vue" rel="nofollow noreferrer">https://github.com/vuejs/vue</a></p>