| 1 |
// Copyright 2009 the Sputnik authors. All rights reserved. |
| 2 |
// This code is governed by the BSD license found in the LICENSE file. |
| 3 |
|
| 4 |
/*--- |
| 5 |
info: | |
| 6 |
pattern is an object R whose [[Class]] property is "RegExp" and flags |
| 7 |
is not undefined. If ToString(pattern) is not a valid flags arguments, |
| 8 |
then throw a SyntaxError exception |
| 9 |
es5id: 15.10.4.1_A2_T2 |
| 10 |
description: > |
| 11 |
Checking if execution of "new RegExp(pattern, {})", where the |
| 12 |
pattern is "/1?1/mig", fails |
| 13 |
---*/ |
| 14 |
|
| 15 |
//CHECK#1 |
| 16 |
try { |
| 17 |
$ERROR('#1.1: new RegExp(/1?1/mig, {}) throw SyntaxError. Actual: ' + (new RegExp(/1?1/mig, {}))); |
| 18 |
} catch (e) { |
| 19 |
if ((e instanceof SyntaxError) !== true) { |
| 20 |
$ERROR('#1.2: new RegExp(/1?1/mig, {}) throw SyntaxError. Actual: ' + (e)); |
| 21 |
} |
| 22 |
} |