Backed out 17 changesets (bug 1898153) as reuqested by Aryx for causing wasm crashes.
[gecko.git] / js / src / tests / test262 / built-ins / RegExp / prototype / Symbol.search / y-fail-return.js
blob4944a8ad494334336f74510b00389ef8266b2c78
1 // Copyright (C) 2015 the V8 project authors. All rights reserved.
2 // This code is governed by the BSD license found in the LICENSE file.
4 /*---
5 description: Stops match execution after first match failure
6 es6id: 21.2.5.9
7 info: |
8     21.2.5.9 RegExp.prototype [ @@search ] ( string )
10     [...]
11     9. Let result be RegExpExec(rx, S).
13     21.2.5.2.2 Runtime Semantics: RegExpBuiltinExec ( R, S )
15     [...]
16     4. Let lastIndex be ToLength(Get(R,"lastIndex")).
17     [...]
18     8. Let sticky be ToBoolean(Get(R, "sticky")).
19     [...]
20     15. Repeat, while matchSucceeded is false
21         [...]
22         b. Let r be matcher(S, lastIndex).
23         c. If r is failure, then
24            i. If sticky is true, then
25               [...]
26               3. Return null.
27 features: [Symbol.search]
28 ---*/
30 assert.sameValue(/a/y[Symbol.search]('ba'), -1);
32 reportCompare(0, 0);