code: function(aSrc, aDeep) {
      if (!aSrc || typeof aSrc != "object") {
        return aSrc;
      } else if (aSrc instanceof Date) {
        return new Date(aSrc.getTime());
      } else if ("clone" in aSrc) {
        return aSrc.clone();
      } else if (Array.isArray(aSrc)) {
        var arr = [];
        for (var i = 0; i < aSrc.length; i++) {
          arr.push(aDeep ? ICAL.helpers.clone(aSrc[i], true) : aSrc[i]);
        }
        return arr;
      } else {
        var obj = {};
        for (var name in aSrc) {
          // uses prototype method to allow use of Object.create(null);
          /* istanbul ignore else */
          if (Object.prototype.hasOwnProperty.call(aSrc, name)) {
            if (aDeep) {
              obj[name] = ICAL.helpers.clone(aSrc[name], true);
            } else {
              obj[name] = aSrc[name];
            }
          }
        }
        return obj;
      }
    }
docs: Clone the passed object or primitive. By default a shallow clone will be
  executed.
  
  @param {*} aSrc            The thing to clone
  @param {Boolean=} aDeep    If true, a deep clone will be performed
  @return {*}                The copy of the thing