S15.10.7_A3_T1.js (741B)
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 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);