code: 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;
  }
docs: ES6 21.2.5.3.