• littledan's avatar
    Separate String.prototype.replace into RegExp.prototype[Symbol.replace] · 837e374e
    littledan authored
    This patch implements one aspect of ES2015 RegExp subclassing:
    String.prototype.replace is separated into two parts, a method on
    RegExp.prototype in case the first argument is a RegExp, and the
    String.prototype.replace method, which handles the string pattern
    case. This separation is described in the ES2015 specification.
    Most of the patch is simply moving code from string.js to regexp.js.
    
    R=yangguo
    LOG=Y
    BUG=v8:4343
    
    Review URL: https://codereview.chromium.org/1590673002
    
    Cr-Commit-Position: refs/heads/master@{#33393}
    837e374e
string-replace.js 690 Bytes