summaryrefslogtreecommitdiffstats
path: root/js/src/tests/test262/built-ins/RegExp/prototype/sticky/this-val-regexp.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/src/tests/test262/built-ins/RegExp/prototype/sticky/this-val-regexp.js')
-rw-r--r--js/src/tests/test262/built-ins/RegExp/prototype/sticky/this-val-regexp.js26
1 files changed, 26 insertions, 0 deletions
diff --git a/js/src/tests/test262/built-ins/RegExp/prototype/sticky/this-val-regexp.js b/js/src/tests/test262/built-ins/RegExp/prototype/sticky/this-val-regexp.js
new file mode 100644
index 0000000000..4308d25afb
--- /dev/null
+++ b/js/src/tests/test262/built-ins/RegExp/prototype/sticky/this-val-regexp.js
@@ -0,0 +1,26 @@
+// Copyright (C) 2015 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+description: >
+ `sticky` accessor function invoked on a RegExp instance
+es6id: 21.2.5.12
+info: |
+ 21.2.5.12 get RegExp.prototype.sticky
+
+ 4. Let flags be the value of R’s [[OriginalFlags]] internal slot.
+ 5. If flags contains the code unit "y", return true.
+ 6. Return false.
+---*/
+
+assert.sameValue(/./.sticky, false);
+assert.sameValue(/./i.sticky, false);
+assert.sameValue(/./g.sticky, false);
+assert.sameValue(/./gi.sticky, false);
+
+assert.sameValue(/./y.sticky, true);
+assert.sameValue(/./iy.sticky, true);
+assert.sameValue(/./yg.sticky, true);
+assert.sameValue(/./iyg.sticky, true);
+
+reportCompare(0, 0);