18de765e1e
This updates fast path checks in string's search/match/replace/split/matchAll methods. Bug: v8:8361 Change-Id: I0377aff21e380d6c718e7471f8964e10c030281b Reviewed-on: https://chromium-review.googlesource.com/c/1333668 Commit-Queue: Jaroslav Sevcik <jarin@chromium.org> Reviewed-by: Jakob Gruber <jgruber@chromium.org> Cr-Commit-Position: refs/heads/master@{#57509}
11 lines
294 B
JavaScript
11 lines
294 B
JavaScript
// Copyright 2018 the V8 project authors. All rights reserved.
|
|
// Use of this source code is governed by a BSD-style license that can be
|
|
// found in the LICENSE file.
|
|
|
|
var s = "baa";
|
|
|
|
assertEquals(1, s.search(/a/));
|
|
|
|
RegExp.prototype[Symbol.search] = () => 42;
|
|
assertEquals(42, s.search(/a/));
|