v8/test/mjsunit/regexp-override-symbol-match.js
Jaroslav Sevcik 18de765e1e [constant-tracking] Properly check regexp proto symbols in string search.
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}
2018-11-14 15:56:04 +00:00

11 lines
298 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(["aa"], s.match(/a./));
RegExp.prototype[Symbol.match] = () => 42;
assertEquals(42, s.match(/a./));