dist/vue.runtime.esm.js
function defineReactive$$1 (
  obj,
  key,
  val,
  customSetter,
  shallow
) {
  var dep = new Dep();

  var property = Object.getOwnPropertyDescriptor(obj, key);
  if (property && property.configurable === false) {
    return
  }

  // cater for pre-defined getter/setters
  var getter = property && property.get;
  var setter = property && property.set;
  if ((!getter || setter) && arguments.length === 2) {
    val = obj[key];
  }

  var childOb = !shallow && observe(val);
  Object.defineProperty(obj, key, {
    enumerable: true,
    configurable: true,
    get: function reactiveGetter () {
      var value = getter ? getter.call(obj) : val;
      if (Dep.target) {
        dep.depend();
        if (childOb) {
          childOb.dep.depend();
          if (Array.isArray(value)) {
            dependArray(value);
          }
        }
      }
      return value
    },
    set: function reactiveSetter (newVal) {
      var value = getter ? getter.call(obj) : val;
      /* eslint-disable no-self-compare */
      if (newVal === value || (newVal !== newVal && value !== value)) {
        return
      }
      /* eslint-enable no-self-compare */
      if (process.env.NODE_ENV !== 'production' && customSetter) {
        customSetter();
      }
      // #7981: for accessor properties without setter
      if (getter && !setter) { return }
      if (setter) {
        setter.call(obj, newVal);
      } else {
        val = newVal;
      }
      childOb = !shallow && observe(newVal);
      dep.notify();
    }
  });
}
function defineReactive$$1 (
  obj,
  key,
  val,
  customSetter,
  shallow
) {
  var dep = new Dep();

  var property = Object.getOwnPropertyDescriptor(obj, key);
  if (property && property.configurable === false) {
    return
  }

  // cater for pre-defined getter/setters
  var getter = property && property.get;
  var setter = property && property.set;
  if ((!getter || setter) && arguments.length === 2) {
    val = obj[key];
  }

  var childOb = !shallow && observe(val);
  Object.defineProperty(obj, key, {
    enumerable: true,
    configurable: true,
    get: function reactiveGetter () {
      var value = getter ? getter.call(obj) : val;
      if (Dep.target) {
        dep.depend();
        if (childOb) {
          childOb.dep.depend();
          if (Array.isArray(value)) {
            dependArray(value);
          }
        }
      }
      return value
    },
    set: function reactiveSetter (newVal) {
      var value = getter ? getter.call(obj) : val;
      /* eslint-disable no-self-compare */
      if (newVal === value || (newVal !== newVal && value !== value)) {
        return
      }
      /* eslint-enable no-self-compare */
      if (process.env.NODE_ENV !== 'production' && customSetter) {
        customSetter();
      }
      // #7981: for accessor properties without setter
      if (getter && !setter) { return }
      if (setter) {
        setter.call(obj, newVal);
      } else {
        val = newVal;
      }
      childOb = !shallow && observe(newVal);
      dep.notify();
    }
  });
}
function defineReactive$$1 ( obj , key , val , customSetter , shallow ) { var dep = new Dep ( ) ; var property = Object . getOwnPropertyDescriptor ( obj , key ) ; if ( property && property . configurable === false ) { return } // cater for pre-defined getter/setters var getter = property && property . get ; var setter = property && property . set ; if ( ( ! getter || setter ) && arguments . length === 2 ) { val = obj [ key ] ; } var childOb = ! shallow && observe ( val ) ; Object . defineProperty ( obj , key , { enumerable : true , configurable : true , get : function reactiveGetter ( ) { var value = getter ? getter . call ( obj ) : val ; if ( Dep . target ) { dep . depend ( ) ; if ( childOb ) { childOb . dep . depend ( ) ; if ( Array . isArray ( value ) ) { dependArray ( value ) ; } } } return value } , set : function reactiveSetter ( newVal ) { var value = getter ? getter . call ( obj ) : val ; /* eslint-disable no-self-compare */ if ( newVal === value || ( newVal !== newVal && value !== value ) ) { return } /* eslint-enable no-self-compare */ if ( process . env . NODE_ENV !== 'production' && customSetter ) { customSetter ( ) ; } // #7981: for accessor properties without setter if ( getter && ! setter ) { return } if ( setter ) { setter . call ( obj , newVal ) ; } else { val = newVal ; } childOb = ! shallow && observe ( newVal ) ; dep . notify ( ) ; } } ) ; }
Define a reactive property on an Object.
Define a reactive property on an Object .