Debian Codegraph @

js/src/tests/test262/built-ins/RegExp/S15.10.4.1_A1_T3.js

raw
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_T3
9 description: Pattern is /[a-b]/g and RegExp is new RegExp(pattern,void 0)
10 ---*/
11
12 var __pattern = /[a-b]/g;
13 var __re = new RegExp(__pattern, void 0);
14
15 assert.sameValue(
16 __re.source,
17 __pattern.source,
18 'The value of __re.source is expected to equal the value of __pattern.source'
19 );
20
21 assert.sameValue(
22 __re.multiline,
23 __pattern.multiline,
24 'The value of __re.multiline is expected to equal the value of __pattern.multiline'
25 );
26
27 assert.sameValue(
28 __re.global,
29 __pattern.global,
30 'The value of __re.global is expected to equal the value of __pattern.global'
31 );
32
33 assert.sameValue(
34 __re.ignoreCase,
35 __pattern.ignoreCase,
36 'The value of __re.ignoreCase is expected to equal the value of __pattern.ignoreCase'
37 );
38
39 reportCompare(0, 0);