function registerSystem(name, definition) {
  var i;
  var NewSystem;
  var proto = {};
  var scenes = _utils_index_js__WEBPACK_IMPORTED_MODULE_2__.findAllScenes(document);

  // Format definition object to prototype object.
  Object.keys(definition).forEach(function (key) {
    proto[key] = {
      value: definition[key],
      writable: true
    };
  });
  if (systems[name]) {
    throw new Error('The system `' + name + '` has been already registered. ' + 'Check that you are not loading two versions of the same system ' + 'or two different systems of the same name.');
  }
  NewSystem = function (sceneEl) {
    System.call(this, sceneEl);
  };
  NewSystem.prototype = Object.create(System.prototype, proto);
  NewSystem.prototype.name = name;
  NewSystem.prototype.constructor = NewSystem;
  NewSystem.prototype.schema = _utils_index_js__WEBPACK_IMPORTED_MODULE_2__.extend((0,_schema_js__WEBPACK_IMPORTED_MODULE_0__.process)(NewSystem.prototype.schema));
  systems[name] = NewSystem;

  // Initialize systems for existing scenes
  if (_readyState_js__WEBPACK_IMPORTED_MODULE_3__.canInitializeElements) {
    for (i = 0; i < scenes.length; i++) {
      scenes[i].initSystem(name);
    }
  }
}
Registers a system to A-Frame.

@param {string} name - Component name.
@param {object} definition - Component property and methods.