| 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 |
If pattern is an object R whose [[Class]] property is "RegExp" and flags is undefined, then let P be |
| 7 |
the pattern used to construct R and let F be the flags used to construct R |
| 8 |
es5id: 15.10.4.1_A1_T4 |
| 9 |
description: Pattern is new RegExp and RegExp is new RegExp(pattern,undefined) |
| 10 |
---*/ |
| 11 |
|
| 12 |
var __pattern = new RegExp; |
| 13 |
var __re = new RegExp(__pattern, undefined); |
| 14 |
|
| 15 |
//CHECK#1 |
| 16 |
if (__re.source !== __pattern.source) { |
| 17 |
$ERROR('#1: __pattern = new RegExp; __re = new RegExp(__pattern, undefined); __re.source === __pattern.source. Actual: '+ (__re.source)); |
| 18 |
} |
| 19 |
|
| 20 |
//CHECK#2 |
| 21 |
if (__re.multiline !== __pattern.multiline) { |
| 22 |
$ERROR('#2: __pattern = new RegExp; __re = new RegExp(__pattern, undefined); __re.multiline === __pattern.multiline. Actual: ' + (__re.multiline)); |
| 23 |
} |
| 24 |
|
| 25 |
//CHECK#3 |
| 26 |
if (__re.global !== __pattern.global) { |
| 27 |
$ERROR('#3: __pattern = new RegExp; __re = new RegExp(__pattern, undefined); __re.global === __pattern.global. Actual: ' + (__re.global)); |
| 28 |
} |
| 29 |
|
| 30 |
//CHECK#4 |
| 31 |
if (__re.ignoreCase !== __pattern.ignoreCase) { |
| 32 |
$ERROR('#4: __pattern = new RegExp; __re = new RegExp(__pattern, undefined); __re.ignoreCase === __pattern.ignoreCase. Actual: ' + (__re.ignoreCase)); |
| 33 |
} |