split.js
function makeGlobal(pattern) {
  var flags = 'g';

  if (pattern.multiline) flags += 'm';
  if (pattern.ignoreCase) flags += 'i';
  if (pattern.sticky) flags += 'y';
  if (pattern.unicode) flags += 'u';

  return new RegExp(pattern.source, flags);
}
function makeGlobal(pattern) {
  var flags = 'g';

  if (pattern.multiline) flags += 'm';
  if (pattern.ignoreCase) flags += 'i';
  if (pattern.sticky) flags += 'y';
  if (pattern.unicode) flags += 'u';

  return new RegExp(pattern.source, flags);
}
function makeGlobal ( pattern ) { var flags = 'g' ; if ( pattern . multiline ) flags += 'm' ; if ( pattern . ignoreCase ) flags += 'i' ; if ( pattern . sticky ) flags += 'y' ; if ( pattern . unicode ) flags += 'u' ; return new RegExp ( pattern . source , flags ) ; }
Function used to make the given pattern global.

@param  {RegExp} pattern - Regular expression to make global.
@return {RegExp}
Function used to make the given pattern global .