summaryrefslogtreecommitdiffstats
path: root/js/src/tests/test262/built-ins/RegExp/prototype/no-regexp-matcher.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/src/tests/test262/built-ins/RegExp/prototype/no-regexp-matcher.js')
-rw-r--r--js/src/tests/test262/built-ins/RegExp/prototype/no-regexp-matcher.js24
1 files changed, 24 insertions, 0 deletions
diff --git a/js/src/tests/test262/built-ins/RegExp/prototype/no-regexp-matcher.js b/js/src/tests/test262/built-ins/RegExp/prototype/no-regexp-matcher.js
new file mode 100644
index 0000000000..27fc38ac8a
--- /dev/null
+++ b/js/src/tests/test262/built-ins/RegExp/prototype/no-regexp-matcher.js
@@ -0,0 +1,24 @@
+// Copyright (C) 2016 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+esid: sec-properties-of-the-regexp-prototype-object
+description: >
+ The RegExp prototype object does not have a [[RegExpMatcher]] internal slot
+info: |
+ The RegExp prototype object is an ordinary object. It is not a RegExp
+ instance and does not have a [[RegExpMatcher]] internal slot or any of the
+ other internal slots of RegExp instance objects.
+
+ 21.2.5.2 RegExp.prototype.exec
+
+ 1. Let R be the this value.
+ 2. If Type(R) is not Object, throw a TypeError exception.
+ 3. If R does not have a [[RegExpMatcher]] internal slot, throw a TypeError
+ exception.
+---*/
+
+assert.throws(TypeError, function() {
+ RegExp.prototype.exec('');
+});
+
+reportCompare(0, 0);