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

/*---
description: Return value when no matches occur with the `global` flag
es6id: 21.2.5.6
info: |
    [...]
    7. If global is false, then
       [...]
    8. Else global is true,
       [...]
       g. Repeat,
          i. Let result be RegExpExec(rx, S).
          ii. ReturnIfAbrupt(result).
          iii. If result is null, then
               1. If n=0, return null.
features: [Symbol.match]
---*/

assert.sameValue(/a/g[Symbol.match]('b'), null);

reportCompare(0, 0);