summaryrefslogtreecommitdiffstats
path: root/js/src/tests/test262/built-ins/RegExp/prototype/Symbol.search/coerce-string.js
blob: b649f6f1bbbf504f0870307b3f4960d994a69385 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
// Copyright (C) 2015 the V8 project authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.

/*---
es6id: 21.2.5.9
description: String coercion of `string` argument
info: |
    [...]
    3. Let S be ToString(string).
    [...]
features: [Symbol.search]
---*/

var obj = {
  toString: function() {
    return 'toString value';
  }
};

assert.sameValue(/ring/[Symbol.search](obj), 4);

reportCompare(0, 0);