| 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_T1 |
| 7 |
description: > |
| 8 |
Checking type of RegExp instance with operators typeof, instanceof |
| 9 |
and check it constructor. RegExp instance is /[^a]* / |
| 10 |
---*/ |
| 11 |
|
| 12 |
var __re = /[^a]*/; |
| 13 |
|
| 14 |
//CHECK#1 |
| 15 |
if (typeof __re !== "object") { |
| 16 |
$ERROR('#1: __re = /[^a]*/; typeof __re === "object". Actual: ' + (typeof __re)); |
| 17 |
} |
| 18 |
|
| 19 |
//CHECK#1 |
| 20 |
if (__re.constructor !== RegExp) { |
| 21 |
$ERROR('#2: __re = /[^a]*/; __re.constructor === RegExp. Actual: ' + (__re.constructor)); |
| 22 |
} |
| 23 |
|
| 24 |
//CHECK#3 |
| 25 |
if ((__re instanceof RegExp) !== true) { |
| 26 |
$ERROR('#3: __re = /[^a]*/; (__re instanceof RegExp) === true'); |
| 27 |
} |