/* global window */
export default function(Handlebars) {
  /* istanbul ignore next */
  let root = typeof global !== 'undefined' ? global : window,
      $Handlebars = root.Handlebars;
  /* istanbul ignore next */
  Handlebars.noConflict = function() {
    if (root.Handlebars === Handlebars) {
      root.Handlebars = $Handlebars;
    }
  };
}

/* global window */
export default function(Handlebars) {
  /* istanbul ignore next */
  let root = typeof global !== 'undefined' ? global : window,
      $Handlebars = root.Handlebars;
  /* istanbul ignore next */
  Handlebars.noConflict = function() {
    if (root.Handlebars === Handlebars) {
      root.Handlebars = $Handlebars;
    }
    return Handlebars;
  };
}

Return current handlebars instance from noConflict
Return current handlebars instance from noConflict

Fixes wycats/handlebars-site#131