summaryrefslogtreecommitdiffstats
path: root/js/src/tests/test262/built-ins/RegExp/prototype/Symbol.match/g-init-lastindex.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/src/tests/test262/built-ins/RegExp/prototype/Symbol.match/g-init-lastindex.js')
-rw-r--r--js/src/tests/test262/built-ins/RegExp/prototype/Symbol.match/g-init-lastindex.js22
1 files changed, 22 insertions, 0 deletions
diff --git a/js/src/tests/test262/built-ins/RegExp/prototype/Symbol.match/g-init-lastindex.js b/js/src/tests/test262/built-ins/RegExp/prototype/Symbol.match/g-init-lastindex.js
new file mode 100644
index 0000000000..f407004ff4
--- /dev/null
+++ b/js/src/tests/test262/built-ins/RegExp/prototype/Symbol.match/g-init-lastindex.js
@@ -0,0 +1,22 @@
+// Copyright (C) 2015 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+description: Initializing the value of `lastIndex` on "global" instances
+es6id: 21.2.5.6
+info: |
+ 7. If global is false, then
+ [...]
+ 8. Else global is true,
+ [...]
+ c. Let setStatus be Set(rx, "lastIndex", 0, true).
+features: [Symbol.match]
+---*/
+
+var r = /./g;
+
+r.lastIndex = 1;
+
+assert.notSameValue(r[Symbol.match]('a'), null);
+
+reportCompare(0, 0);