aboutsummaryrefslogtreecommitdiff
path: root/deps/v8/test/mjsunit/regress/regress-v8-8357.js
blob: 6f27e84abb3aa6f8b1c4538dd140032b84051698 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
// 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.

// Flags: --allow-natives-syntax

const s = "Umbridge has been reading your mail, Harry."

{
  let monkey_called = false;
  s.__proto__.__proto__[Symbol.replace] =
    () => { monkey_called = true; };
  s.replace(s);
  assertTrue(monkey_called);
}

{
  let monkey_called = false;
  s.__proto__.__proto__[Symbol.search] =
    () => { monkey_called = true; };
  s.search(s);
  assertTrue(monkey_called);
}

{
  let monkey_called = false;
  s.__proto__.__proto__[Symbol.match] =
    () => { monkey_called = true; };
  s.match(s);
  assertTrue(monkey_called);
}