text: var inherits = require("@nathanfaucett/inherits"),
      createPool = require("@nathanfaucett/create_pool"),
      nativeEventToJSON = require("../../utils/nativeEventToJSON"),
      getEvent = require("../getters/getEvent");
  
  
  var SyntheticEventPrototype;
  
  
  module.exports = SyntheticEvent;
  
  
  function SyntheticEvent(nativeEvent, eventHandler) {
  
      getEvent(this, nativeEvent, eventHandler);
  
      this.isPersistent = false;
  }
  createPool(SyntheticEvent);
  SyntheticEventPrototype = SyntheticEvent.prototype;
  
  SyntheticEvent.extend = function(child) {
      inherits(child, this);
      createPool(child);
      return child;
  };
  
  SyntheticEvent.create = function create(nativeEvent, eventHandler) {
      return this.getPooled(nativeEvent, eventHandler);
  };
  
  SyntheticEventPrototype.destructor = function() {
      this.nativeEvent = null;
      this.type = null;
      this.target = null;
      this.currentTarget = null;
      this.componentTarget = null;
      this.currentComponentTarget = null;
      this.eventPhase = null;
      this.path = null;
      this.bubbles = null;
      this.cancelable = null;
      this.timeStamp = null;
      this.defaultPrevented = null;
      this.propagationStopped = null;
      this.returnValue = null;
      this.isTrusted = null;
      this.isPersistent = null;
      this.value = null;
  };
  
  SyntheticEventPrototype.destroy = function() {
      this.constructor.release(this);
  };
  
  SyntheticEventPrototype.preventDefault = function() {
      var event = this.nativeEvent;
  
      if (event.preventDefault) {
          event.preventDefault();
      } else {
          event.returnValue = false;
      }
  
      this.defaultPrevented = true;
  };
  
  SyntheticEventPrototype.stopPropagation = function() {
      var event = this.nativeEvent;
  
      if (event.stopPropagation) {
          event.stopPropagation();
      } else {
          event.cancelBubble = false;
      }
  
      this.propagationStopped = true;
  };
  
  SyntheticEventPrototype.persist = function() {
      this.isPersistent = true;
  };
  
  SyntheticEventPrototype.stopImmediatePropagation = SyntheticEventPrototype.stopPropagation;
  
  SyntheticEventPrototype.toJSON = function(json) {
      json = json || {};
  
      json.nativeEvent = nativeEventToJSON(this.nativeEvent);
      json.type = this.type;
      json.target = null;
      json.currentTarget = this.currentTarget;
      json.eventPhase = this.eventPhase;
      json.bubbles = this.bubbles;
      json.cancelable = this.cancelable;
      json.timeStamp = this.timeStamp;
      json.defaultPrevented = this.defaultPrevented;
      json.propagationStopped = this.propagationStopped;
      json.isTrusted = this.isTrusted;
  
      return json;
  };