Debian Codegraph @

js/src/tests/test262/built-ins/RegExp/S15.10.7_A3_T2.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: RegExp instance type is RegExp
6 es5id: 15.10.7_A3_T2
7 description: >
8 Checking type of RegExp instance with operators typeof, instanceof
9 and check it constructor. RegExp instance is new RegExp
10 ---*/
11
12 var __re = new RegExp;
13
14 assert.sameValue(typeof __re, "object", 'The value of `typeof __re` is expected to be "object"');
15 assert.sameValue(__re.constructor, RegExp, 'The value of __re.constructor is expected to equal the value of RegExp');
16
17 assert.sameValue(
18 __re instanceof RegExp,
19 true,
20 'The result of evaluating (__re instanceof RegExp) is expected to be true'
21 );
22
23 reportCompare(0, 0);