old_contents: Error.prototype.toJSON = function() {
    var json = {};
  
    Object.getOwnPropertyNames(this).forEach(function(key) {
      json[key] = this[key];
    }, this);
    return json;
  };
  
new_contents: Error.prototype.toJSON = function() {
    return {
      type: this.constructor.name,
      message: this.message,
      stack: this.stack
    };
  };
  
subject: Unify error toJSON