Ignore:
Timestamp:
Nov 21, 2019, 3:18:48 PM (6 years ago)
Author:
[email protected]
Message:

Unreviewed, rolling out r252683 and r252721.
https://bugs.webkit.org/show_bug.cgi?id=204475

13% regression in JetStream2/prepack-wtb (Requested by
yusukesuzuki on #webkit).

Reverted changesets:

"Implement String.prototype.replaceAll"
https://bugs.webkit.org/show_bug.cgi?id=202471
https://trac.webkit.org/changeset/252683

"Unreviewed, address Darin's feedback on r252683."
https://trac.webkit.org/changeset/252721

Location:
trunk/Source/JavaScriptCore/builtins
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/builtins/BuiltinNames.h

    r252683 r252753  
    133133    macro(replaceUsingRegExp) \
    134134    macro(replaceUsingStringSearch) \
    135     macro(replaceAllUsingStringSearch) \
    136135    macro(makeTypeError) \
    137136    macro(mapBucket) \
  • trunk/Source/JavaScriptCore/builtins/StringPrototype.js

    r252683 r252753  
    260260}
    261261
    262 function replaceAll(search, replace)
    263 {
    264     "use strict";
    265 
    266     if (@isUndefinedOrNull(this))
    267         @throwTypeError("String.prototype.replaceAll requires |this| not to be null nor undefined");
    268 
    269     if (search != null) {
    270         if (@isRegExp(search) && !@stringIncludesInternal.@call(@toString(search.flags), "g"))
    271             @throwTypeError("String.prototype.replaceAll argument must not be a non-global regular expression");
    272 
    273         var replacer = search.@replaceSymbol;
    274         if (replacer !== @undefined) {
    275             if (!@hasObservableSideEffectsForStringReplace(search, replacer))
    276                 return @toString(this).@replaceUsingRegExp(search, replace);
    277             return replacer.@call(search, this, replace);
    278         }
    279     }
    280 
    281     var thisString = @toString(this);
    282     var searchString = @toString(search);
    283     return thisString.@replaceAllUsingStringSearch(searchString, replace);
    284 }
    285 
    286262function search(regexp)
    287263{
Note: See TracChangeset for help on using the changeset viewer.