Bug 1892041 - Part 2: Update test262. r=spidermonkey-reviewers,dminor
[gecko.git] / js / src / tests / test262 / built-ins / RegExp / unicode_restricted_brackets.js
blobda3c2f3f38aefa5d183cce312a76b1e7e992d2cb
1 // Copyright (C) 2015 AndrĂ© Bargull. All rights reserved.
2 // This code is governed by the BSD license found in the LICENSE file.
4 /*---
5 description: B.1.4 is not applied for Unicode RegExp - Standalone brackets
6 info: |
7     The compatibility extensions defined in B.1.4 Regular Expressions Patterns
8     are not applied for Unicode RegExp.
9     Tested extension: "Atom[U] :: PatternCharacter"
10 es6id: 21.1.2
11 ---*/
13 // Single parentheses and brackets.
14 assert.throws(SyntaxError, function() {
15   RegExp("(", "u");
16 }, 'RegExp("(", "u"): ');
17 assert.throws(SyntaxError, function() {
18   RegExp(")", "u");
19 }, 'RegExp(")", "u"): ');
20 assert.throws(SyntaxError, function() {
21   RegExp("[", "u");
22 }, 'RegExp("[", "u"): ');
23 assert.throws(SyntaxError, function() {
24   RegExp("]", "u");
25 }, 'RegExp("]", "u"): ');
26 assert.throws(SyntaxError, function() {
27   RegExp("{", "u");
28 }, 'RegExp("{", "u"): ');
29 assert.throws(SyntaxError, function() {
30   RegExp("}", "u");
31 }, 'RegExp("}", "u"): ');
33 reportCompare(0, 0);