(function (global, factory) {
  if (typeof exports === 'object') {
    module.exports = factory(require('moment'));
  } else if (typeof define === 'function' && define.amd) {
    define(['moment'], factory);
  } else {
    global.moment = factory(global.moment);
  }
}(this, function(moment) {

  var immutableMethods = [
    // Display
    'format',
    'fromNow',
    'from',
    'calendar',
    'diff',
    'valueOf',
    'unix',
    'daysInMonth',
    'toArray',
    'toJSON',
    'toISOString',
    // Query
    'isBefore',
    'isSame',
    'isAfter',
    'isBetween',
    'isLeapYear',
    'isDST',
    'isDSTShifted'
  ];

  var frozenProto = Object.create(moment.fn);
  function frozenMethodGenerator(orig) {
    return function () {
      return orig.apply(this.freeze(), arguments);
    };
  }
  function mixin(dest, props) {
    for (var prop in props) {
      if (props.hasOwnProperty(prop)) {
        dest[prop] = props[prop];
      }
    }
  }

  for (var key in moment.fn) {
    var func = moment.fn[key];
    if (moment.fn.hasOwnProperty(key) && typeof func === 'function') {
      if (immutableMethods.indexOf(key) === -1) {
        frozenProto[key] = frozenMethodGenerator(func);
      }
    }
  }
  moment.fn.isFrozen = function () {
    return this.__frozen;
  };
  moment.fn.freeze = function () {
    var props = moment.fn.clone.apply(this);
    var frozen = Object.create(frozenProto);
    mixin(frozen, props);
    return frozen;
  };
  frozenProto.thaw = function () {
    return this.clone();
  };
  frozenProto.__frozen = true;

  return moment;

}));

@@ -276,16 +276,17 @@
 function
+ 
 (moment)
@@ -316,16 +316,101 @@
 ods = %5B%0A
+    // Get%0A    'weeksInYear',%0A    'isoWeeksInYear',%0A    'get',%0A    'max',%0A    'min',%0A
     // D
@@ -716,51 +716,752 @@
 %0A%0A  
-var frozenProto = Object.create(moment.fn);
+// moment has a lot of overloaded getters and setters, where calling the%0A  // method with no arguments will run an immutable getter, and calling the%0A  // method with one or more arguments will run a mutating setter.%0A  var mutatorsIfArguments = %5B%0A    // Get + Set%0A    'millisecond', 'milliseconds',%0A    'second', 'seconds',%0A    'minute', 'minutes',%0A    'hour', 'hours',%0A    'date', 'dates',%0A    'day', 'days',%0A    'weekday',%0A    'isoWeekday',%0A    'dayOfYear',%0A    'week', 'weeks',%0A    'isoWeek', 'isoWeeks',%0A    'month', 'months',%0A    'quarter',%0A    'year', 'years',%0A    'weekYear',%0A    'isoWeekYear',%0A    'set'%0A  %5D;%0A%0A  function frozenMethodGenerator(orig) %7B%0A    return function () %7B%0A      return orig.apply(this.freeze(), arguments);%0A    %7D;%0A  %7D
 %0A  f
@@ -1466,32 +1466,43 @@
  function frozen
+IfArguments
 MethodGenerator(
@@ -1526,32 +1526,64 @@
 n function () %7B%0A
+      if (arguments.length) %7B%0A  
       return ori
@@ -1609,32 +1609,71 @@
 (), arguments);%0A
+      %7D%0A      return orig.apply(this);%0A
     %7D;%0A  %7D%0A  fun
@@ -1822,16 +1822,62 @@
  %7D%0A  %7D%0A%0A
+  var frozenProto = Object.create(moment.fn);%0A
   for (v
@@ -1930,16 +1930,17 @@
 n%5Bkey%5D;%0A
+%0A
     if (
@@ -1968,16 +1968,24 @@
 rty(key)
+%0A       
  && type
@@ -2006,30 +2006,28 @@
 unction'
-) %7B
 %0A      
-if (
+  && 
 immutabl
@@ -2057,16 +2057,70 @@
 == -1) %7B
+%0A%0A      if (mutatorsIfArguments.indexOf(key) === -1) %7B
 %0A       
@@ -2167,32 +2167,115 @@
 r(func);%0A      %7D
+ else %7B%0A        frozenProto%5Bkey%5D = frozenIfArgumentsMethodGenerator(func);%0A      %7D%0A
 %0A    %7D%0A  %7D%0A  mom

Improve performance for moment's getters