summaryrefslogtreecommitdiffstats
path: root/js/src/tests/test262/language/statements/class/subclass/builtin-objects/RegExp/lastIndex.js
blob: bf0726227b5948940690e1363e06ffbf94eeb769 (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
// Copyright (C) 2016 the V8 project authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
es6id: 21.2.6.1
description: Instances has the own property lastIndex
info: |
  21.2.6.1 lastIndex

  The value of the lastIndex property specifies the String index at which to
  start the next match. It is coerced to an integer when used (see 21.2.5.2.2).
  This property shall have the attributes { [[Writable]]: true, [[Enumerable]]:
  false, [[Configurable]]: false }.
includes: [propertyHelper.js]
---*/

class RE extends RegExp {}

var re = new RE('39?');

re.exec('TC39');

assert.sameValue(re.lastIndex, 0);

verifyWritable(re, 'lastIndex');
verifyNotEnumerable(re, 'lastIndex');
verifyNotConfigurable(re, 'lastIndex');

reportCompare(0, 0);