code: function (value) {
          setProp (this, 'then', value && value.prototype === INTERNAL ?
              thenProp : // Restore to original property descriptor.
              {
                  get: function(){
                      return value; // Getter returning provided value (behaves like value is just changed)
                  },
                  set: thenProp.set // Keep a setter that is prepared to restore original.
              }
          );
      }
docs: Be idempotent and allow another framework (such as zone.js or another instance of a Dexie.Promise module) to replace Promise.prototype.then and when that framework wants to restore the original property, we must identify that and restore the original property descriptor.