summaryrefslogtreecommitdiffstats
path: root/js/src/tests/test262/built-ins/RegExp/prototype/exec/u-lastindex-value.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/src/tests/test262/built-ins/RegExp/prototype/exec/u-lastindex-value.js')
-rw-r--r--js/src/tests/test262/built-ins/RegExp/prototype/exec/u-lastindex-value.js32
1 files changed, 32 insertions, 0 deletions
diff --git a/js/src/tests/test262/built-ins/RegExp/prototype/exec/u-lastindex-value.js b/js/src/tests/test262/built-ins/RegExp/prototype/exec/u-lastindex-value.js
new file mode 100644
index 0000000000..5c31efb0ef
--- /dev/null
+++ b/js/src/tests/test262/built-ins/RegExp/prototype/exec/u-lastindex-value.js
@@ -0,0 +1,32 @@
+// Copyright (C) 2015 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+description: Definition of `lastIndex` property value
+es6id: 21.2.5.2.2
+info: |
+ 21.2.5.2.2 Runtime Semantics: RegExpBuiltinExec ( R, S )
+
+ [...]
+ 12. Let flags be the value of R’s [[OriginalFlags]] internal slot.
+ 13. If flags contains "u", let fullUnicode be true, else let fullUnicode be
+ false.
+ [...]
+ 16. Let e be r's endIndex value.
+ 17. If fullUnicode is true, then
+ a. e is an index into the Input character list, derived from S, matched
+ by matcher. Let eUTF be the smallest index into S that corresponds
+ to the character at element e of Input. If e is greater than or
+ equal to the length of Input, then eUTF is the number of code units
+ in S.
+ b. Let e be eUTF.
+ 18. If global is true or sticky is true,
+ a. Let setStatus be Set(R, "lastIndex", e, true).
+ b. ReturnIfAbrupt(setStatus).
+---*/
+
+var r = /./ug;
+r.exec('𝌆');
+assert.sameValue(r.lastIndex, 2);
+
+reportCompare(0, 0);