Debian Codegraph @

tests/auto/qml/ecmascripttests/test262/test/language/literals/regexp/lastIndex.js

raw
1 // Copyright (C) 2016 the V8 project authors. All rights reserved.
2 // This code is governed by the BSD license found in the LICENSE file.
3 /*---
4 esid: sec-regular-expression-literals-runtime-semantics-evaluation
5 description: Initial state of the `lastIndex` property
6 info: |
7 [...]
8 3. Return RegExpCreate(pattern, flags).
9
10 21.2.3.2.3 Runtime Semantics: RegExpCreate
11
12 1. Let obj be ? RegExpAlloc(%RegExp%).
13 2. Return ? RegExpInitialize(obj, P, F).
14
15 21.2.3.2.2 Runtime Semantics: RegExpInitialize
16
17 [...]
18 12. Perform ? Set(obj, "lastIndex", 0, true).
19 [...]
20
21 21.2.3.2.1 Runtime Semantics: RegExpAlloc
22
23 [...]
24 2. Perform ! DefinePropertyOrThrow(obj, "lastIndex", PropertyDescriptor
25 {[[Writable]]: true, [[Enumerable]]: false, [[Configurable]]: false}).
26 [...]
27 includes: [propertyHelper.js]
28 ---*/
29
30 var re = /./;
31
32 assert.sameValue(re.lastIndex, 0);
33
34 verifyNotEnumerable(re, 'lastIndex');
35 verifyWritable(re, 'lastIndex');
36 verifyNotConfigurable(re, 'lastIndex');