code: function RegExpCompileJS(pattern, flags) {
    if (!IS_REGEXP(this)) {
      throw MakeTypeError(kIncompatibleMethodReceiver,
                          "RegExp.prototype.compile", this);
    }
  
    if (IS_REGEXP(pattern)) {
      if (!IS_UNDEFINED(flags)) throw MakeTypeError(kRegExpFlags);
  
      flags = PatternFlags(pattern);
      pattern = REGEXP_SOURCE(pattern);
    }
  
    RegExpInitialize(this, pattern, flags);
  
    // Return undefined for compatibility with JSC.
    // See http://crbug.com/585775 for web compat details.
  }
docs: ES#sec-regexp.prototype.compile RegExp.prototype.compile (pattern, flags)