deps/v8/src/js/regexp.js
function RegExpGetFlags() {
  if (!IS_RECEIVER(this)) {
    throw MakeTypeError(
        kRegExpNonObject, "RegExp.prototype.flags", TO_STRING(this));
  }
  var result = '';
  if (this.global) result += 'g';
  if (this.ignoreCase) result += 'i';
  if (this.multiline) result += 'm';
  if (this.unicode) result += 'u';
  if (this.sticky) result += 'y';
  return result;
}
function RegExpGetFlags() {
  if (!IS_RECEIVER(this)) {
    throw MakeTypeError(
        kRegExpNonObject, "RegExp.prototype.flags", TO_STRING(this));
  }
  var result = '';
  if (this.global) result += 'g';
  if (this.ignoreCase) result += 'i';
  if (this.multiline) result += 'm';
  if (this.unicode) result += 'u';
  if (this.sticky) result += 'y';
  return result;
}
ES6 21.2.5.3.