| 1 |
// Copyright (C) 2015 André Bargull. All rights reserved. |
| 2 |
// This code is governed by the BSD license found in the LICENSE file. |
| 3 |
|
| 4 |
/*--- |
| 5 |
description: B.1.4 is not applied for Unicode RegExp - Incomplete quantifiers |
| 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 |
---*/ |
| 12 |
|
| 13 |
// Incomplete quantifier with atom. |
| 14 |
assert.throws(SyntaxError, function() { |
| 15 |
RegExp("a{", "u"); |
| 16 |
}, 'RegExp("a{", "u"): '); |
| 17 |
assert.throws(SyntaxError, function() { |
| 18 |
RegExp("a{1", "u"); |
| 19 |
}, 'RegExp("a{1", "u"): '); |
| 20 |
assert.throws(SyntaxError, function() { |
| 21 |
RegExp("a{1,", "u"); |
| 22 |
}, 'RegExp("a{1,", "u"): '); |
| 23 |
assert.throws(SyntaxError, function() { |
| 24 |
RegExp("a{1,2", "u"); |
| 25 |
}, 'RegExp("a{1,2", "u"): '); |
| 26 |
|
| 27 |
|
| 28 |
// Incomplete quantifier without atom. |
| 29 |
assert.throws(SyntaxError, function() { |
| 30 |
RegExp("{", "u"); |
| 31 |
}, 'RegExp("{", "u"): '); |
| 32 |
assert.throws(SyntaxError, function() { |
| 33 |
RegExp("{1", "u"); |
| 34 |
}, 'RegExp("{1", "u"): '); |
| 35 |
assert.throws(SyntaxError, function() { |
| 36 |
RegExp("{1,", "u"); |
| 37 |
}, 'RegExp("{1,", "u"): '); |
| 38 |
assert.throws(SyntaxError, function() { |
| 39 |
RegExp("{1,2", "u"); |
| 40 |
}, 'RegExp("{1,2", "u"): '); |